### Example: List Operator Chart Versions (including development) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL Demonstrates how to use `helm search repo` to list all available versions of the Intel Device Plugins Operator chart, including pre-release and development versions. The output shows chart version, app version, and a brief description. ```bash $ helm search repo intel/intel-device-plugins-operator --versions --devel NAME CHART VERSION APP VERSION DESCRIPTION intel/intel-device-plugins-operator 0.26.0 0.26.0 A Helm chart for Intel Device Plugins Operator ... intel/intel-device-plugins-operator 0.25.1 0.25.1 A Helm chart for Intel Device Plugins Operator ... intel/intel-device-plugins-operator 0.25.1-helm.0 0.25.0 A Helm chart for Intel Device Plugins Operator ... intel/intel-device-plugins-operator 0.25.0 0.25.0 A Helm chart for Intel Device Plugins Operator ... intel/intel-device-plugins-operator 0.24.1 0.24.1 A Helm chart for Intel Device Plugins Operator ... intel/intel-device-plugins-operator 0.24.1-helm.0 0.24.0 A Helm chart for Intel Device Plugins Operator ... intel/intel-device-plugins-operator 0.24.0 0.24.0 A Helm chart for Intel Device Plugins Operator ... ``` -------------------------------- ### Setup and Run Controller Integration Tests (Shell) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL This sequence of commands sets up the environment for running controller integration tests using `setup-envtest`. It involves installing the tool, specifying a Kubernetes version, and then running the tests with the configured environment. ```shell go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest setup-envtest use KUBEBUILDER_ASSETS=$(setup-envtest use -i -p path ) make envtest ``` -------------------------------- ### Deploy Intel IAA Plugin with Init Container Provisioning Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/iaa_plugin/README Deploys the Intel IAA device plugin along with an init container for automatic provisioning of IAA devices and workqueues. This simplifies setup by configuring devices before the main plugin starts. ```bash $ kubectl apply -k deployments/iaa_plugin/overlays/iaa_initcontainer/ ``` -------------------------------- ### QAT Plugin Helm Chart Values Example Source: https://intel.github.io/intel-device-plugins-for-kubernetes/INSTALL This example illustrates the specific Helm chart values for the qat plugin. It shows configurations for image settings, DPDK driver, kernel VF drivers, maximum device count, log level, node selectors, and node feature rule. These values can be modified to tailor the qat plugin's behavior. ```yaml name: qatdeviceplugin-sample image: hub: intel tag: "" initImage: hub: intel tag: "" dpdkDriver: vfio-pci kernelVfDrivers: - 4xxxvf - 420xxvf maxNumDevices: 128 logLevel: 4 nodeSelector: intel.feature.node.kubernetes.io/qat: 'true' nodeFeatureRule: true ``` -------------------------------- ### Build and Run libdlb Example (Make/Bash) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/dlb_plugin/README Compiles the libdlb example application and runs it to test DLB functionality. This involves navigating to the libdlb directory, running make, and executing the example with specific parameters. ```bash cd ./dlb/libdlb/ && make && sudo LD_LIBRARY_PATH=$PWD ./examples/dir_traffic -n 128 -d 1 ``` -------------------------------- ### Get Source Code with Git Clone Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Clones the intel-device-plugins-for-kubernetes repository using git. Requires git to be installed on the system. Sets an environment variable for the source directory. ```bash $ export INTEL_DEVICE_PLUGINS_SRC=/path/to/intel-device-plugins-for-kubernetes $ git clone https://github.com/intel/intel-device-plugins-for-kubernetes ${INTEL_DEVICE_PLUGINS_SRC} ``` -------------------------------- ### Build and Install DPDK Source: https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/dlb_plugin/README Builds and installs the DPDK package from source. It uses meson for configuration and ninja for building. The output is installed to a specified directory. ```bash cd ./dpdk-* && meson setup --prefix $(pwd)/installdir builddir && ninja -C builddir install ``` -------------------------------- ### Example E2E Test Filtering (QAT DC OpenSSL) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/DEVEL Example of running E2E tests for QAT with DC resource and the openssl application. ```go go test -v ./test/e2e/... -args -ginkgo.focus "Device:qat.*Resource:dc.*App:openssl" ``` -------------------------------- ### Examples of E2E Test Filtering Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Illustrative examples of how to use Ginkgo focus and skip flags to run specific subsets of E2E tests based on device, mode, resource, and application. ```bash # DLB for VF resource without any app go test -v ./test/e2e/... -args -ginkgo.focus "Device:dlb.*Resource:vf.*App:noapp" # FPGA with af mode and opae-nlb-demo app go test -v ./test/e2e/... -args -ginkgo.focus "Device:fpga.*Mode:af.*App:opae-nlb-demo" # GPU with only tensorflow app go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu.*App:tensorflow" # Or GPU excluding busybox app go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu" -ginkgo.skip "App:busybox" # QAT for cy resource with openssl app go test -v ./test/e2e/... -args -ginkgo.focus "Device:qat.*Resource:cy.*App:openssl" # SGX without sgx-sdk-demo app go test -v ./test/e2e/... -args -ginkgo.focus "Device:sgx" -ginkgo.skip "App:sgx-sdk-demo" # All Sapphire Rapids device plugins (dlb, dsa, iaa, qat, sgx) go test -v ./test/e2e/... -args -ginkgo.focus "Device:(dlb|dsa|iaa|qat|sgx)" ``` -------------------------------- ### Run libdlb Example Application Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/dlb_plugin/README Compiles and runs the 'dir_traffic' example application from the libdlb library to test DLB device functionality. It requires the libdlb library to be built and specifies the number of iterations and the target DLB device. ```bash cd ./dlb/libdlb/ && make && sudo LD_LIBRARY_PATH=$PWD ./examples/dir_traffic -n 128 -d 1 ``` -------------------------------- ### FFmpeg QSV Device Selection for Multi-GPU Setups Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/gpu_plugin/README This example shows how to explicitly select a GPU device file for FFmpeg when using the QSV (Media SDK) backend in multi-GPU environments. This is crucial for media applications that do not automatically handle device discovery in complex multi-GPU setups. ```bash ffmpeg -init_hw_device qsv=hw:0 -filter_hw_device hw:0 -i input.mp4 -c:v hevc_qsv output.mp4 ``` -------------------------------- ### Example E2E Test: FPGA OPAE NLB Demo Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Example command to run E2E tests for FPGA with 'af' mode and the 'opae-nlb-demo' application. This illustrates how to combine multiple label criteria for focusing tests. ```bash go test -v ./test/e2e/... -args -ginkgo.focus "Device:fpga.*Mode:af.*App:opae-nlb-demo" ``` -------------------------------- ### FPGA Tool Command Line Arguments Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/fpga_tool/README Lists the available commands for the Intel FPGA test tool, enabling actions such as information retrieval, installation, and programming. ```bash info, fpgainfo, install, list, fmeinfo, portinfo, list-fme, list-port, pr, release, assign ``` -------------------------------- ### Install Specific Intel Device Plugin using Helm Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL Installs a specific Intel device plugin (e.g., GPU, SGX, QAT) using its corresponding Helm chart. This command deploys the plugin to the specified namespace and enables NodeFeatureRule discovery. ```bash helm install intel/intel-device-plugins- --namespace inteldeviceplugins-system --create-namespace \ --set nodeFeatureRule=true ``` -------------------------------- ### Build and Install DPDK with DLB Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/dlb_plugin/README This snippet demonstrates the process of building the DPDK library with DLB support and installing it to a specified directory. It assumes a Ubuntu/Debian-based distribution and utilizes meson and ninja build tools. The output is installed to a local 'installdir'. ```bash ls dlb dpdk-21.11 cd ./dpdk-* && meson setup --prefix $(pwd)/installdir builddir && ninja -C builddir install ``` -------------------------------- ### Example Pod Request for QAT Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting QAT resources. The device namespace is 'qat.intel.com' and various resource types like 'generic', 'cy', 'dc', etc., are supported. Consult the QAT plugin documentation for specific resource names. ```yaml apiVersion: v1 kind: Pod metadata: name: compress-perf-dpdk-pod spec: containers: - name: qat-container image: resources: limits: qat.intel.com/dc: 1 ``` -------------------------------- ### Example E2E Test: GPU with TensorFlow App Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/DEVEL Example commands to run E2E tests for GPU devices, focusing on the TensorFlow application, or alternatively, focusing on GPU and skipping the busybox app. ```bash #or go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu" -ginkgo.skip "App:busybox" ``` -------------------------------- ### FFmpeg VA-API Device Selection for Multi-GPU Setups Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/gpu_plugin/README This example demonstrates how to specify a particular GPU device file for FFmpeg when using the VA-API, especially in multi-GPU configurations. This is necessary because VA-API and legacy QSV do not dynamically select the correct device and require explicit configuration. ```bash ffmpeg -vaapi_device /dev/dri/renderD129 -i input.mp4 output.mp4 ``` -------------------------------- ### Example E2E Test: QAT Openssl App Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Example command to run E2E tests for QAT devices on the 'cy' resource, specifically with the 'openssl' application. This demonstrates filtering tests by device, resource, and application. ```bash go test -v ./test/e2e/... -args -ginkgo.focus "Device:qat.*Resource:cy.*App:openssl" ``` -------------------------------- ### Instantiate and Run Device Plugin Manager (Go) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL This Go code snippet illustrates the basic usage of the `deviceplugin.Manager` to run a device plugin. It shows how to create a new manager instance with a namespace and a plugin implementation, and then start its execution. ```go func main() { ... manager := dpapi.NewManager(namespace, plugin) manager.Run() } ``` -------------------------------- ### Build and Install DPDK for DLB Tests Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/dlb_plugin/README This snippet covers the steps to install build dependencies, configure, build, and install the DPDK (Data Plane Development Kit) library, which is necessary for running DLB-related tests. It assumes an Ubuntu/Debian-based system for package installation. ```bash sudo apt-get update && sudo apt-get install build-essential meson python3-pyelftools libnuma-dev python3-pip && sudo pip install ninja cd ./dpdk-* && meson setup --prefix $(pwd)/installdir builddir && ninja -C builddir install ``` -------------------------------- ### Example E2E Test: DLB VF Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Example command to run E2E tests specifically for the DLB device with VF resource, without any specific application running. This demonstrates the use of focus labels for precise test selection. ```bash go test -v ./test/e2e/... -args -ginkgo.focus "Device:dlb.*Resource:vf.*App:noapp" ``` -------------------------------- ### Build and Install DPDK Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/dlb_plugin/README Installs build dependencies, configures, builds, and installs the DPDK (Data Plane Development Kit) library. This is a prerequisite for running DPDK-based tests and applications. Assumes a Debian/Ubuntu-based system for package installation. ```bash sudo apt-get update && sudo apt-get install build-essential meson python3-pyelftools libnuma-dev python3-pip && sudo pip install ninja ls cd ./dpdk-* && meson setup --prefix $(pwd)/installdir builddir && ninja -C builddir install ``` -------------------------------- ### List Available Helm Chart Versions Source: https://intel.github.io/intel-device-plugins-for-kubernetes/INSTALL Searches the Helm repositories for available versions of the Intel Device Plugins Operator and specific plugin charts. This command helps in identifying and selecting the desired chart versions for installation, including development versions. ```bash helm search repo intel/intel-device-plugins-operator --versions helm search repo intel/intel-device-plugins- --versions # Example to include development versions: $ helm search repo intel/intel-device-plugins-operator --versions --devel ``` -------------------------------- ### Example Pod Request for FPGA Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting an FPGA resource. The device namespace is 'fpga.intel.com'. Specific resource mappings should be checked in the FPGA device plugin documentation. ```yaml apiVersion: v1 kind: Pod metadata: name: intelfpga-job spec: containers: - name: fpga-container image: resources: limits: fpga.intel.com/custom-resource: 1 ``` -------------------------------- ### Example E2E Test Filtering (GPU TensorFlow) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/DEVEL Example of running E2E tests for GPU, specifically focusing on the TensorFlow application. ```go go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu.*App:tensorflow" ``` -------------------------------- ### Install NFD for Intel GPU Plugin (Bash) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/gpu_plugin/advanced-install This command installs Node Feature Discovery (NFD) into a Kubernetes cluster using `kubectl` and kustomize. NFD is a prerequisite for the NFD-based installation method of the Intel GPU plugin, enabling the discovery and labeling of node features like GPUs. Replace `` with the correct release tag. ```bash kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=' ``` -------------------------------- ### Publish Intel Device Plugins Operator to operatorhub.io Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Commands for generating a bundle, building and pushing the bundle image, and installing the operator for verification. This process prepares the operator for publication on operatorhub.io. ```bash # Clone the Community Operators repository git clone https://github.com//community-operators # Generate bundle and build bundle image make bundle TAG=0.X.Y CHANNELS=stable DEFAULT_CHANNEL=stable make bundle-build # Push the image to a registry (example for Docker Hub) # docker.io//intel-device-plugins-operator:0.X.Y # Install and verify operator deployment operator-sdk olm install kubectl create namespace testoperator operator-sdk run bundle : -n testoperator # ... perform verification checks ... # Clean up operator deployment operator-sdk cleanup intel-device-plugins-operator --namespace testoperator kubectl delete namespace testoperator operator-sdk olm uninstall # Commit changes to the Community Operators repo cd community-operators git add operators/intel-device-plugins-operator/0.X.Y git commit -am "operators intel-device-plugins-operator (0.X.Y)" -s ``` -------------------------------- ### Example E2E Test: All Sapphire Rapids Devices Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Example command to run E2E tests for all devices associated with Sapphire Rapids, including DLB, DSA, IAA, QAT, and SGX. This uses a regex group to efficiently select multiple device types. ```bash go test -v ./test/e2e/... -args -ginkgo.focus "Device:(dlb|dsa|iaa|qat|sgx)" ``` -------------------------------- ### Example Pod Request for IAA Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting an IAA resource. The device namespace is 'iaa.intel.com' and the registered resources are 'wq-user-[shared or dedicated]'. ```yaml apiVersion: v1 kind: Pod metadata: name: iaa-accel-config-demo spec: containers: - name: iaa-demo image: resources: limits: iaa.intel.com/wq-user-dedicated: 1 ``` -------------------------------- ### Install Intel GPU Plugin with NFD, Monitoring, Shared-dev (kubectl) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/gpu_plugin/advanced-install This method installs the Intel GPU plugin using NFD for node selection, with monitoring and shared devices enabled. It requires installing NFD first, then configuring NodeFeatureRules, and finally applying the GPU plugin daemonset. This approach is ideal for retrieving GPU metrics and managing shared devices. Replace `` with the target version. ```bash # Start NFD - if your cluster doesn't have NFD installed yet $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=' # Create NodeFeatureRules for detecting GPUs on nodes $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=' # Create GPU plugin daemonset $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/monitoring_shared-dev_nfd/?ref=' ``` -------------------------------- ### Install DPDK Build Dependencies Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/dlb_plugin/README Installs necessary packages for building DPDK, including essential build tools, meson, Python development files, NUMA libraries, and the 'ninja' build system tool via pip. This is a prerequisite for compiling DPDK from source. ```bash sudo apt-get update && sudo apt-get install build-essential meson python3-pyelftools libnuma-dev python3-pip && sudo pip install ninja ``` -------------------------------- ### List Available Helm Chart Versions Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/INSTALL Demonstrates how to use `helm search repo` to list all available versions for the Intel device plugin operator and specific plugins. The `--devel` flag can be used to include development versions. ```bash helm search repo intel/intel-device-plugins-operator --versions helm search repo intel/intel-device-plugins- --versions # Example with development versions: helm search repo intel/intel-device-plugins-operator --versions --devel ``` -------------------------------- ### Install Intel GPU Plugin with NFD, Monitoring, and Shared-dev Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/gpu_plugin/advanced-install This set of commands installs the Intel GPU plugin using Node Feature Discovery (NFD) for node selection, along with enabling monitoring and shared device capabilities. This method is beneficial for collecting GPU metrics and is useful with tools like XPU-Manager or collectd. Remember to replace `` with the correct version. ```bash # Start NFD - if your cluster doesn't have NFD installed yet $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=' # Create NodeFeatureRules for detecting GPUs on nodes $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=' # Create GPU plugin daemonset $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/monitoring_shared-dev_nfd/?ref=' ``` -------------------------------- ### Example Pod Request for NPU Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting an NPU resource. The device namespace is 'npu.intel.com' and the registered resource is 'accel'. ```yaml apiVersion: v1 kind: Pod metadata: name: intel-npu-workload spec: containers: - name: npu-container image: resources: limits: npu.intel.com/accel: 1 ``` -------------------------------- ### Install Controller-Gen for CRD Generation Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL This command installs `controller-gen`, a tool used for generating Custom Resource Definition (CRD) and webhook artifacts. It requires Go and specifies the version of `controller-gen` to install. The input is the Go toolchain and the desired version, and the output is the installed `controller-gen` binary. ```bash GO111MODULE=on go get -u sigs.k8s.io/controller-tools/cmd/controller-gen@ ``` -------------------------------- ### Install Intel DSA Device Plugin (Kustomize) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/dsa_plugin/README Deploys the Intel DSA device plugin to a Kubernetes cluster using Kustomize. Replace `` with the desired release tag or 'main' for development images. This command applies the plugin definition from a remote URL. ```bash $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/dsa_plugin?ref=' daemonset.apps/intel-dsa-plugin created ``` -------------------------------- ### Data Center GPU Labels - Flex 170 (NFD Rule Example) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/gpu_plugin/labels This example illustrates the additional labels created by specific NFD rules for Intel data center GPUs, using the Flex 170 as an example. It includes labels for the total device count, GPU family, and product name. ```text gpu.intel.com/device.count=1 gpu.intel.com/family=Flex_Series gpu.intel.com/product=Flex_170 ``` -------------------------------- ### Example Pod Request for DSA Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting a DSA resource. The device namespace is 'dsa.intel.com' and the registered resources are 'wq-user-[shared or dedicated]'. ```yaml apiVersion: v1 kind: Pod metadata: name: dsa-accel-config-demo spec: containers: - name: dsa-demo image: resources: limits: dsa.intel.com/wq-user-shared: 1 ``` -------------------------------- ### Verify cert-manager Installation with kubectl Source: https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/fpga_plugin/README This command verifies the installation and running status of the cert-manager components, which is a prerequisite for deploying the FPGA admission controller webhook. ```bash kubectl get pods -n cert-manager ``` -------------------------------- ### Deploy DPDK QAT Applications using Kustomize Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/qat_plugin/README Applies the default DPDK crypto-perf and compress-perf applications using Kustomize. This is the standard deployment method. It assumes Kustomize is installed and configured. ```bash $ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/qat_dpdk_app/ $ kubectl get pods NAME READY STATUS RESTARTS AGE qat-dpdk-test-crypto-perf 1/1 Running 0 27m qat-dpdk-test-compress-perf 1/1 Running 0 27m intel-qat-plugin-5zgvb 1/1 Running 0 3h ``` -------------------------------- ### Example Pod Request for DLB Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting a DLB resource. The device namespace is 'dlb.intel.com' and the registered resources are 'pf' or 'vf'. ```yaml apiVersion: v1 kind: Pod metadata: name: dlb-libdlb-demo spec: containers: - name: dlb-demo image: resources: limits: dlb.intel.com/pf: 1 ``` -------------------------------- ### Example Pod Request for GPU Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting GPU resources. The device namespace is 'gpu.intel.com' and the registered resources can be 'i915', 'i915_monitoring', 'xe', or 'xe_monitoring'. ```yaml apiVersion: v1 kind: Pod metadata: name: intelgpu-job spec: containers: - name: gpu-container image: resources: limits: gpu.intel.com/xe: 1 ``` -------------------------------- ### Install Intel GPU Plugin with NFD, Monitoring, Shared-dev (Bash) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/gpu_plugin/advanced-install This command installs the Intel GPU plugin configured for NFD, monitoring, and shared devices using `kubectl` and kustomize. This method leverages NFD labels for targeted deployment and enables the collection of GPU metrics, useful for tools like XPU-Manager or collectd. Ensure `` is updated. ```bash kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/monitoring_shared-dev_nfd/?ref=' ``` -------------------------------- ### Run Tests with Kind (Makefile) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL This snippet demonstrates running tests that do not depend on hardware using Kind, a tool for running local Kubernetes clusters. Ensure Kind is installed on your host before execution. ```makefile make test-with-kind ``` -------------------------------- ### Example E2E Test: GPU TensorFlow App Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Example commands to run E2E tests for GPU devices, specifically targeting the TensorFlow application. It shows both a direct focus and a focus with skipping other applications. ```bash #or go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu.*App:tensorflow" go test -v ./test/e2e/... -args -ginkgo.focus "Device:gpu" -ginkgo.skip "App:busybox" ``` -------------------------------- ### Get E2E Test Help Information Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Command to display the help information for the E2E tests. This provides a list of all available arguments and options for customizing test execution. ```bash go test ./test/e2e/... -args -help ``` -------------------------------- ### Uninstall Intel Device Plugins and Related Components Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL These commands demonstrate how to uninstall each installed component, including Intel device plugins, the dp-operator, node-feature-discovery (nfd), and cert-manager. It's recommended to repeat the plugin uninstallation for each installed plugin. ```bash # repeat first step as many times as there are plugins installed helm uninstall -n inteldeviceplugins-system helm uninstall -n inteldeviceplugins-system dp-operator helm uninstall -n node-feature-discovery nfd helm uninstall -n cert-manager cert-manager ``` -------------------------------- ### Install Controller-Gen Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Installs controller-gen, a tool for generating Kubernetes API definitions and controllers. It's necessary for working with Device Plugins CRDs and controllers. ```bash $ GO111MODULE=on go get -u sigs.k8s.io/controller-tools/cmd/controller-gen@ ``` -------------------------------- ### Deploy QAT Plugin with Specific Release Version (Kubectl) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/qat_plugin/README This command deploys the Intel QAT device plugin for Kubernetes using a pre-built image from Docker Hub. Replace `` with the desired release tag or 'main' for development images. This method installs the plugin using a DaemonSet. ```bash kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/qat_plugin?ref=' ``` -------------------------------- ### Publish Intel Device Plugins Operator Source: https://intel.github.io/intel-device-plugins-for-kubernetes/DEVEL Commands to generate and build the operator bundle, and push the image to a registry. It also includes steps for installing and running the operator in a development cluster, committing changes, and submitting a PR. ```bash git clone https://github.com//community-operators make bundle TAG=0.X.Y CHANNELS=stable DEFAULT_CHANNEL=stable make bundle-build # If pushing to Docker Hub: docker.io/: # If pushing to local registry: --use-http operator-sdk olm install kubectl create namespace testoperator operator-sdk run bundle : -n testoperator # ... verification checks ... operator-sdk cleanup intel-device-plugins-operator --namespace testoperator kubectl delete namespace testoperator operator-sdk olm uninstall cd community-operators git add operators/intel-device-plugins-operator/0.X.Y git commit -am 'operators intel-device-plugins-operator (0.X.Y)' -s ``` -------------------------------- ### Build and Apply DLB Demo Pods Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/dlb_plugin/README Builds Docker images for DLB demo applications (libdlb and dpdk) and applies their respective Kubernetes pod definitions. These commands are used to test the functionality of the DLB device plugin by running example workloads. ```bash make dlb-libdlb-demo ... Successfully tagged intel/dlb-libdlb-demo:devel kubectl apply -f ${INTEL_DEVICE_PLUGINS_SRC}/demo/dlb-libdlb-demo-pod.yaml pod/dlb-libdlb-demo-pod created make dlb-dpdk-demo ... Successfully tagged intel/dlb-dpdk-demo:devel kubectl apply -f ${INTEL_DEVICE_PLUGINS_SRC}/demo/dlb-dpdk-demo-pod.yaml pod/dlb-dpdk-demo-pod created ``` -------------------------------- ### DPDK DSA Configuration Example Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/dsa_plugin/README Example JSON configuration for DPDK applications using DSA. It specifies workqueue mode as 'dedicated' and requires a specific name prefix for the workqueue. ```json { "dev":"wqX.0", "mode":"dedicated", "size":16, "group_id":0, "priority":10, "block_on_fault":1, "type":"user", "name":"dpdk_X0", "driver_name":"user", "threshold":15 } ``` -------------------------------- ### Install and Run Intel Device Plugins Operator Locally Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/DEVEL Steps to install and run the Intel Device Plugins Operator in a development cluster using operator-sdk and OLM. This includes creating a namespace, running the bundle, performing verification, and cleaning up resources. ```bash operator-sdk olm install kubectl create namespace testoperator operator-sdk run bundle : -n testoperator # do verification checks ... # do clean up operator-sdk cleanup intel-device-plugins-operator --namespace testoperator kubectl delete namespace testoperator operator-sdk olm uninstall ``` -------------------------------- ### Build All Container Images with Make Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Builds all Docker images for the device plugins. This is a slow process and requires 'cpp' to be installed. It generates Dockerfiles on the fly. ```bash $ make images ``` -------------------------------- ### List Available Helm Chart Versions Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL Queries Helm repositories to list all available versions for the Intel device plugin operator and specific plugins. This is useful for selecting a particular version or checking for development releases. ```bash helm search repo intel/intel-device-plugins-operator --versions helm search repo intel/intel-device-plugins- --versions ``` -------------------------------- ### Example Pod Request for SGX EPC Resource Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/index This example shows a pod configuration requesting SGX EPC memory. The device namespace is 'sgx.intel.com' and the registered resource is 'epc'. ```yaml apiVersion: v1 kind: Pod metadata: name: intelsgx-job spec: containers: - name: sgx-container image: resources: limits: sgx.intel.com/epc: 1 ``` -------------------------------- ### Deploying SGX Components using Release Tags Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/sgx_plugin/README This example shows how to deploy Intel SGX components in a Kubernetes cluster using pre-built Docker images. It emphasizes substituting a release version or 'main' for the 'devel' tag. ```bash # Replace with the desired release tag or 'main' for devel images. # Example: kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/sgx/./ ``` -------------------------------- ### Install Intel DSA Device Plugin with InitContainer (Kustomize) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/cmd/dsa_plugin/README Deploys the Intel DSA device plugin along with an initcontainer for automatic provisioning of DSA devices and workqueues. This command applies a specific Kustomize overlay located in the repository. ```bash $ kubectl apply -k deployments/dsa_plugin/overlays/dsa_initcontainer/ ``` -------------------------------- ### Install QAT Device Plugin using kubectl Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/qat_plugin/README This command applies the QAT device plugin using kubectl with a specified release version from GitHub. Replace `` with the desired tag or 'main' for development images. ```shell kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/qat_plugin?ref=' ``` -------------------------------- ### Install cert-manager using Helm Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL Installs the cert-manager component using Helm, which is a dependency for managing certificates within Kubernetes. This command ensures that cert-manager is deployed with its Custom Resource Definitions (CRDs) and waits for the installation to complete. ```bash helm install --wait \ cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --version v1.15.2 \ --set installCRDs=true ``` -------------------------------- ### Show Helm Chart Values for QAT Plugin Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/INSTALL Shows the specific Helm chart values for the QAT (QuickAssist Technology) plugin. This allows users to see and modify parameters like image hub and tag, DPDK driver, kernel VF drivers, max devices, log level, node selectors, and node feature rule settings. ```bash $ helm show values intel/intel-device-plugins-qat name: qatdeviceplugin-sample image: hub: intel tag: "" initImage: hub: intel tag: "" dpdkDriver: vfio-pci kernelVfDrivers: - 4xxxvf - 420xxvf maxNumDevices: 128 logLevel: 4 nodeSelector: intel.feature.node.kubernetes.io/qat: 'true' nodeFeatureRule: true ``` -------------------------------- ### Install NPU Plugin with NFD - Bash Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/npu_plugin/README This snippet shows how to install the Intel NPU device plugin using Node Feature Discovery (NFD). It first deploys NFD, then configures NFD to detect NPUs, and finally deploys the NPU plugin to nodes labeled by NFD. Replace `` with the desired tag. ```bash # Start NFD - if your cluster doesn't have NFD installed yet $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=' # Create NodeFeatureRules for detecting NPUs on nodes $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=' # Create NPU plugin daemonset $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/npu_plugin/overlays/nfd_labeled_nodes?ref=' ``` -------------------------------- ### Example E2E Test: SGX without App Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/DEVEL Example command to run E2E tests for SGX devices, excluding tests related to the 'sgx-sdk-demo' application. This shows how to use the skip label to exclude specific test scenarios. ```bash go test -v ./test/e2e/... -args -ginkgo.focus "Device:sgx" -ginkgo.skip "App:sgx-sdk-demo" ``` -------------------------------- ### Show Helm Chart Values for QAT Plugin Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/INSTALL This command specifically shows the customizable values for the QAT (QuickAssist Technology) device plugin. It details parameters like image hub and tag, DPDK driver, kernel VF drivers, maximum devices, log level, node selectors, and node feature rule. Requires Helm and the Intel Helm repository. ```shell $ helm show values intel/intel-device-plugins-qat ``` -------------------------------- ### Install DPDK Build Dependencies (Bash) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/dlb_plugin/README This command installs necessary build dependencies for DPDK on a Debian-based system, including essential build tools, meson, Python libraries, and NUMA development files. ```bash sudo apt-get update && sudo apt-get install build-essential meson python3-pyelftools libnuma-dev python3-pip && sudo pip install ninja ``` -------------------------------- ### Add Helm Repositories for Intel Device Plugins Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL This command sequence adds the necessary Helm repositories for installing cert-manager, Node Feature Discovery (NFD), and the Intel device plugin operator and its associated plugins. These repositories are essential for managing the deployment of the device plugins and their dependencies using Helm. ```bash helm repo add jetstack https://charts.jetstack.io # for cert-manager helm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts # for NFD helm repo add intel https://intel.github.io/helm-charts/ # for device-plugin-operator and plugins helm repo update ``` -------------------------------- ### Install Intel GPU Plugin to All Nodes Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/gpu_plugin/advanced-install This command installs the Intel GPU plugin to all nodes in the Kubernetes cluster. It is a simple installation method but may consume unnecessary resources on nodes without Intel GPUs. Ensure you replace `` with the desired plugin version. ```bash kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin?ref=' ``` -------------------------------- ### Run Plugin Binaries with Sudo Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Runs a built plugin binary on the development system. Requires administrator privileges (sudo). Assumes the binary is located in the 'cmd' directory. ```bash $ sudo -E ${INTEL_DEVICE_PLUGINS_SRC}/cmd// ``` -------------------------------- ### Install Intel Device Plugin Operator using Helm Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL Deploys the Intel Device Plugin Operator to the specified namespace using Helm. The operator automates the deployment and management of device plugins based on Custom Resource Definitions (CRDs). ```bash helm install dp-operator intel/intel-device-plugins-operator --namespace inteldeviceplugins-system --create-namespace ``` -------------------------------- ### Build Plugin Binaries with Make Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/DEVEL Builds plugin binaries using the 'make' command. Requires a Go development environment. The specific build target depends on the plugin being built, found in the 'cmd' directory. ```bash $ cd ${INTEL_DEVICE_PLUGINS_SRC} $ make ``` -------------------------------- ### Verify Intel GPU Plugin Installation Source: https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/gpu_plugin/README This command verifies the installation of the Intel GPU plugin by querying Kubernetes nodes and displaying their allocatable resources, specifically focusing on the 'gpu.intel.com/i915' count. This helps confirm that the plugin is correctly reporting GPU availability. ```bash $ kubectl get nodes -o=jsonpath="{range .items[*]}{.metadata.name}{'\n'}{' i915: '}{.status.allocatable.gpu\.intel\.com/i915}{"\n"}" ``` -------------------------------- ### Generic Intel GPU Labels (NFD Rule Example) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/gpu_plugin/labels This example demonstrates the labels generated by a generic NFD rule for an Intel Tigerlake iGPU. It shows how the rule adds labels for the device ID and presence count for each detected PCI device type. ```text gpu.intel.com/device-id.0300-9a49.count=1 gpu.intel.com/device-id.0300-9a49.present=true ``` -------------------------------- ### Build Container Images for Device Plugins Source: https://intel.github.io/intel-device-plugins-for-kubernetes/_sources/DEVEL This process outlines building container images for Intel Device Plugins. It utilizes a Makefile and may require the `cpp` preprocessor. The guide suggests optimizing the build process by running `make vendor` and `make licenses` first. It also mentions the possibility of changing the image build tool (e.g., `buildah`, `podman`) by setting the `BUILDER` argument. ```bash $ make images ``` ```bash $ make vendor ``` ```bash $ make licenses ``` ```bash $ make ``` ```bash $ make licenses/ ``` ```bash $ make BUILDER= ``` -------------------------------- ### Deploy Intel DSA Plugin with Initcontainer (Kubernetes) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/dsa_plugin/README Deploys the Intel DSA device plugin with an initcontainer for automatic provisioning of DSA devices and workqueues. This simplifies the setup for basic DSA resource allocation. ```shell $ kubectl apply -k deployments/dsa_plugin/overlays/dsa_initcontainer/ ``` -------------------------------- ### Install NFD and SGX Plugin with kubectl (Approach 1) Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/sgx_plugin/README Installs Node Feature Discovery (NFD) and the SGX device plugin using kubectl apply with kustomization URLs. This approach deploys NFD, NodeFeatureRules, and then the SGX plugin with EPC-NFD overlay. Assumes a specific release version is substituted for . ```bash # first, deploy NFD and the necessary NodeFeatureRules $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd' $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules' # and then, deploy SGX plugin $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/sgx_plugin/overlays/epc-nfd/' ``` -------------------------------- ### Add Helm Repository Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/README Adds the Intel Helm Charts repository to your Helm configuration. This allows you to easily discover and install Helm charts provided by Intel. ```bash helm repo add intel https://intel.github.io/helm-charts ``` -------------------------------- ### Install Node Feature Discovery (NFD) using Operator Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/sgx_plugin/README Deploys the Node Feature Discovery (NFD) component using kubectl apply with a kustomization URL. This is a prerequisite for some Intel Device Plugin installations. Assumes a specific release version is substituted for . ```bash $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/?ref=' $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=' ``` -------------------------------- ### QAT Device Plugin Deployment with DPDK Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/README This snippet demonstrates the deployment of the QAT device plugin using DPDK for Intel QuickAssist Technology adapters. It is part of the sample deployments and showcases how to integrate QAT acceleration within a Kubernetes environment. ```go // Sample Go code for QAT device plugin deployment would go here. // Actual code not provided in the text, but the structure implies Go implementation. ``` -------------------------------- ### Install Node Feature Discovery (NFD) using Helm Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/INSTALL Installs the Node Feature Discovery (NFD) component via Helm. NFD is used to discover and advertise hardware features of nodes to the Kubernetes cluster, which is often a prerequisite for device plugins to function correctly. ```bash helm install nfd nfd/node-feature-discovery \ --namespace node-feature-discovery --create-namespace --version 0.16.4 ``` -------------------------------- ### Install QAT Device Plugin with Debug Mode Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/cmd/qat_plugin/README This command applies the QAT device plugin with debug mode enabled using kubectl and a specified release version from GitHub. Replace `` with the desired tag or 'main'. ```shell kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/qat_plugin/overlays/debug?ref=' ``` -------------------------------- ### Install Intel GPU Plugin with NFD Source: https://intel.github.io/intel-device-plugins-for-kubernetes/0.34/_sources/cmd/gpu_plugin/README Installs the Intel GPU plugin using Node Feature Discovery (NFD). This method first deploys NFD and its associated NodeFeatureRules to detect Intel GPUs, and then deploys the GPU plugin daemonset to nodes labeled by NFD. Replace `` with the desired release tag or 'main' for development images. The `--dry-run=client -o yaml` flag can be added to kubectl commands to preview the YAML output. ```bash # Start NFD - if your cluster doesn't have NFD installed yet $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=' # Create NodeFeatureRules for detecting GPUs on nodes $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=' # Create GPU plugin daemonset $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/nfd_labeled_nodes?ref=' ```