Attaching NVIDIA GPU devices by using the hcp CLI

You can attach one or more NVIDIA graphics processing unit (GPU) devices to node pools by using the hcp command-line interface (CLI) in a hosted cluster on OpenShift Virtualization.

Important

Attaching NVIDIA GPU devices to node pools is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

Prerequisites
Procedure
  • You can attach the GPU device to node pools during cluster creation by running a command similar to the following example:

    $ hcp create cluster kubevirt \
      --name my-hosted-cluster \
      --node-pool-replicas 3 \
      --pull-secret /user/name/pullsecret \
      --memory 16Gi \
      --cores 2 \
      --host-device-name="nvidia-a100,count:2"
    • --name specifies the name of your hosted cluster.

    • --node-pool-replicas specifies the worker count.

    • --pull-secret specifies the path to your pull secret.

    • --memory specifies a value for memory.

    • --cores specifies a value for CPU.

    • --host-device-name specifies the GPU device name and the count. The --host-device-name argument takes the name of the GPU device from the infrastructure node and an optional count that represents the number of GPU devices you want to attach to each virtual machine (VM) in node pools. The default count is 1. For example, if you attach 2 GPU devices to 3 node pool replicas, all 3 VMs in the node pool are attached to the 2 GPU devices.

      Tip

      You can use the --host-device-name argument multiple times to attach multiple devices of different types.