Using GPU Operator with OpenShift#

For supported OpenShift deployments, choose the driver for your environment:

  • For the NVIDIA Data Center GPU Driver on bare metal or VMware vSphere with GPU passthrough, follow Installing the NVIDIA GPU Operator on OpenShift. Select the Operator and driver versions in the Support Matrix.

  • For the vGPU™ for Compute Guest Driver on VMware vSphere with vGPU, follow the procedure on this page. It configures GPU Operator to install a prebuilt NVIDIA AI Enterprise guest driver image on the worker VMs.

  • For Government Ready components, refer to Government Ready on OpenShift.

Prerequisites for the vGPU Guest Driver#

Before installing the vGPU guest driver, check your configuration in the Support Matrix. You also need:

Prepare VMware vSphere Worker VMs#

Install NVIDIA Virtual GPU Manager on the VMware ESXi hosts and assign a supported vGPU to each GPU worker VM. Refer to Installing NVIDIA Virtual GPU Manager and Configuration. Install OpenShift on vSphere using the Red Hat OpenShift installation instructions.

Configure each worker VM and the worker VM template to use EFI firmware and disable Secure Boot. Power off running worker VMs before changing their firmware settings. To change the template, convert it to a VM, update the settings, and convert it back to a template. For a user-provisioned installation, set EFI before the worker VMs start; for an installer-provisioned installation, set EFI after the VMs are deployed.

In each worker VM’s VM Options > Advanced > Configuration Parameters, set:

Listing 6 Set the 64-bit MMIO parameters on each worker VM#
pciPassthru.use64bitMMIO = TRUE
pciPassthru.64bitMMIOSizeGB = 512

For GPUDirect® RDMA, also set:

Listing 7 Set the GPUDirect RDMA parameters on each worker VM#
pciPassthru.allowP2P = true
pciPassthru.RelaxACSforP2P = true

Install GPU Operator and Configure the Guest Driver#

  1. Install the Node Feature Discovery Operator and the GPU Operator. Wait to create the ClusterPolicy until after you prepare the image pull and licensing Secrets.

  2. In the OpenShift console, select the Operator project, such as nvidia-gpu-operator. Under Workloads > Secrets, select Create > Image Pull Secret. Enter the following values and create the Secret:

    • Secret name: ngc-secret

    • Authentication type: Image registry credentials

    • Registry server address: nvcr.io/nvidia/vgpu

    • Username: $oauthtoken

    • Password: Your NGC API key

    • Email: Your NGC account email address

  3. Save the client configuration token as client_configuration_token.tok and create an empty gridd.conf file. Create a licensing Secret in the Operator namespace:

    Listing 8 Create the licensing Secret#
    $ oc create secret generic licensing-config -n nvidia-gpu-operator \
        --from-file=gridd.conf --from-file=client_configuration_token.tok
    

    Replace nvidia-gpu-operator if you installed the Operator in a different namespace.

  4. In the NGC Catalog, find the vGPU for Compute Guest Driver container for the driver version in the Support Matrix. On the Tags tab, select the image tag for that driver and your OpenShift version. The OpenShift tags include the RHCOS version, for example <driver-version>-rhcos<openshift-version>. Use the image name and tag shown in the catalog for that operating system.

  5. In the OpenShift console, open Installed Operators and select NVIDIA GPU Operator. Installed Operators is under Ecosystem or Operators, depending on the OpenShift version. On the ClusterPolicy tab, select Create ClusterPolicy.

  6. Expand NVIDIA GPU/vGPU Driver config and configure:

    • enabled: Enable the driver.

    • licensingConfig > secretName: licensing-config.

    • licensingConfig > nlsEnabled: Enable NVIDIA License System licensing.

    • repository: nvcr.io/nvidia/vgpu.

    • image: The guest driver image name from the NGC Catalog.

    • version: The guest driver image tag selected for your OpenShift version.

    • Under Advanced configuration > Image Pull Secret, add ngc-secret.

    To use GPUDirect RDMA, enable rdma in the driver configuration. Select Create to create the ClusterPolicy.

Verify the Installation#

Wait for the ClusterPolicy to report ready and for the Operator and driver pods to start. Installation can take several minutes. Replace the namespace below if necessary:

Listing 9 Confirm the ClusterPolicy, pods, and GPU resources#
$ oc get clusterpolicy
$ oc get pods -n nvidia-gpu-operator
$ oc get nodes -o=custom-columns='Node:metadata.name,GPUs:status.capacity.nvidia\.com/gpu'

Check that the GPU worker nodes report GPU resources. To check the license on a worker, replace <driver-pod> with its driver pod name and inspect the vGPU Software Licensed Product license status:

Listing 10 Check the driver pod license status#
$ oc exec -n nvidia-gpu-operator <driver-pod> -c nvidia-driver-ctr -- nvidia-smi -q

Refer to Verifying the License Status of a Licensed NVIDIA vGPU for Compute Guest VM for an example. To replace a licensing token later, refer to Updating the GPU Operator License Token.

For additional OpenShift configuration, upgrades, and troubleshooting, refer to the GPU Operator on OpenShift documentation and OpenShift troubleshooting.