Node Feature Discovery

Node Feature Discovery (NFD) detects Intel GPU hardware and labels nodes so that device plugins and drivers are scheduled only where GPU hardware exists.

On OpenShift, configure NFD through the nfd.openshift.io API group. The NodeFeatureDiscovery custom resource uses nfd.openshift.io/v1 and NodeFeatureRule uses nfd.openshift.io/v1alpha1. The NFD Operator also installs the upstream nfd.k8s-sigs.io CRDs and serves your rules under both groups, which is why a rule you create here also appears in oc get nodefeaturerule.nfd.k8s-sigs.io, and why Helm charts that write upstream NodeFeatureRule objects work on OpenShift too.

Both the Intel GPU Base Operator and the Intel GPU Resource Driver Helm charts can create the Intel GPU NodeFeatureRule; they can also install upstream NFD as a chart dependency. On OpenShift, install NFD using the Red Hat catalog Operator, as described in this guide, and configure the charts to use that existing NFD installation. Do not install NFD through the charts as well. Running multiple NFD instances on one cluster is not supported.

Use the following procedure to install NFD, enable PCI-based GPU detection, and apply a consolidated Intel GPU label to worker nodes.

Installing and configuring Node Feature Discovery Operator

  1. In the OpenShift web console, navigate to Operators > OperatorHub.

  2. Search for Node Feature Discovery.

  3. Install the NFD Operator from the Red Hat catalog. Alternatively, you can also install the operator by using the CLI by creating the namespace, operator group, and subscription, as in the following example:

    apiVersion: v1
    kind: Namespace
    metadata:
      name: openshift-nfd
    ---
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      name: openshift-nfd
      namespace: openshift-nfd
    spec:
      targetNamespaces:
      - openshift-nfd
    ---
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: nfd
      namespace: openshift-nfd
    spec:
      channel: stable
      name: nfd
      source: redhat-operators
      sourceNamespace: openshift-marketplace
      installPlanApproval: Automatic
    
  4. Verify that the operator is running. The stable channel ships the NFD Operator version that matches your OpenShift release, for example 4.22.0 on OpenShift 4.22.

    oc get csv -n openshift-nfd
    oc get pods -n openshift-nfd
    
  5. Create a NodeFeatureDiscovery resource to deploy the NFD master and worker pods.

    apiVersion: nfd.openshift.io/v1
    kind: NodeFeatureDiscovery
    metadata:
      name: nfd-instance
      namespace: openshift-nfd
    spec:
      workerConfig:
        configData: |
          sources:
            pci:
              deviceClassWhitelist:
                - "0300"
                - "0380"
                - "1200"
              deviceLabelFields:
                - vendor
                - device
                - class
    

    The three PCI device classes cover the hardware that Intel GPU components look for:

    | PCI class | Meaning |
    |-----------|---------|
    | `0300` | VGA compatible controller. Used by Intel® Arc™ Pro B-Series GPUs. |
    | `0380` | Display controller (other). Used by headless Intel data center GPUs. |
    | `1200` | Processing accelerator. Used by Intel accelerator cards and matched by the Intel GPU Base Operator 0.4.0 labeling rules. |
    
  6. Wait for the NFD pods to become ready using the following command. You should see nfd-controller-manager, nfd-master, nfd-gc, and nfd-worker pods running.

    oc get pods -n openshift-nfd
    
  7. Using the following command, verify that Intel GPU PCI labels were applied. After the NFD worker is running, it automatically labels nodes with detected PCI devices.

    oc get node <node-name> -o json | jq '.metadata.labels | to_entries[] | select(.key | test("pci.*8086")) | "\(.key) = \(.value)"'
    

    On a node with Intel® Arc™ Pro B70 GPUs, the output looks similar to the following. The device ID in the label is the PCI ID of the GPU, for example e223 for the B70.

    "feature.node.kubernetes.io/pci-0300_8086_e223.present = true"
    "feature.node.kubernetes.io/pci-0300_8086_e223.sriov.capable = true"
    
  8. Apply NodeFeatureRule to add a consolidated label to nodes with Intel GPU hardware. This single label is what the device plugin, the DRA driver, and RHOAI hardware profiles use as a node selector, so you do not have to enumerate PCI IDs in every manifest.

    apiVersion: nfd.openshift.io/v1alpha1
    kind: NodeFeatureRule
    metadata:
      name: intel-gpu-rule
      namespace: openshift-nfd
    spec:
      rules:
      - name: "intel-gpu"
        labels:
          intel.feature.node.kubernetes.io/gpu: "true"
        matchFeatures:
        - feature: pci.device
          matchExpressions:
            vendor:
              op: In
              value: ["8086"]
            class:
              op: In
              value: ["0300", "0380", "1200"]
    
  9. Verify that worker nodes with GPUs are labeled.

    oc get nodes -l intel.feature.node.kubernetes.io/gpu=true
    
  10. Inspect all Intel-related labels on a specific node.

    oc get node <node-name> --show-labels | tr ',' '\n' | grep -i intel
    

After completing this procedure, GPU-enabled nodes are ready for Intel device plugin, DRA driver, or GPU Base Operator deployment.