apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeatureRule
metadata:
  name: intel-gpu-platform-labeling
spec:
  rules:
    - labelsTemplate: |
        {{ range .pci.device }}gpu.intel.com/device-id.{{ .class }}-{{ .device }}.present=true
        {{ end }}
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0300"
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
      name: intel.gpu.generic.deviceid
    - labelsTemplate: gpu.intel.com/device-id.0300-{{ (index .pci.device 0).device }}.count={{ len .pci.device }}
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0300"
            vendor:
              op: In
              value:
                - "8086"
      name: intel.gpu.generic.count.300
    - labelsTemplate: gpu.intel.com/device-id.0380-{{ (index .pci.device 0).device }}.count={{ len .pci.device }}
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
      name: intel.gpu.generic.count.380
    - labels:
        gpu.intel.com/product: "Max_1100"
      labelsTemplate: "gpu.intel.com/device.count={{ len .pci.device }}"
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
            device:
              op: In
              value:
                - "0bda"
      name: intel.gpu.max.1100
    - labels:
        gpu.intel.com/product: "Max_1550"
      labelsTemplate: "gpu.intel.com/device.count={{ len .pci.device }}"
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
            device:
              op: In
              value:
                - "0bd5"
      name: intel.gpu.max.1550
    - labels:
        gpu.intel.com/family: "Max_Series"
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
            device:
              op: In
              value:
                - "0bda"
                - "0bd5"
                - "0bd9"
                - "0bdb"
                - "0bd7"
                - "0bd6"
                - "0bd0"
      name: intel.gpu.max.series
    - labels:
        gpu.intel.com/family: "Flex_Series"
        gpu.intel.com/product: "Flex_170"
      labelsTemplate: "gpu.intel.com/device.count={{ len .pci.device }}"
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
            device:
              op: In
              value:
                - "56c0"
      name: intel.gpu.flex.170
    - labels:
        gpu.intel.com/family: "Flex_Series"
        gpu.intel.com/product: "Flex_140"
      labelsTemplate: "gpu.intel.com/device.count={{ len .pci.device }}"
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0380"
            vendor:
              op: In
              value:
                - "8086"
            device:
              op: In
              value:
                - "56c1"
      name: intel.gpu.flex.140
    - labels:
        gpu.intel.com/family: "A_Series"
      matchFeatures:
        - feature: pci.device
          matchExpressions:
            class:
              op: In
              value:
                - "0300"
            vendor:
              op: In
              value:
                - "8086"
            device:
              op: In
              value:
                - "56a6"
                - "56a5"
                - "56a1"
                - "56a0"
                - "5694"
                - "5693"
                - "5692"
                - "5691"
                - "5690"
                - "56b3"
                - "56b2"
                - "56a4"
                - "56a3"
                - "5697"
                - "5696"
                - "5695"
                - "56b1"
                - "56b0"
                - "56a2"
                - "56ba"
                - "56bc"
                - "56bd"
                - "56bb"
      name: intel.gpu.a.series
