11.2. Configuring vGPU on the Compute nodes
To enable your cloud users to create instances that use a virtual GPU (vGPU), you must configure the Compute nodes that have the physical GPUs:
- Build a custom GPU-enabled overcloud image.
- Prepare the GPU role, profile, and flavor for designating Compute nodes for vGPU.
- Configure the Compute node for vGPU.
- Deploy the overcloud.
To use an NVIDIA GRID vGPU, you must comply with the NVIDIA GRID licensing requirements and you must have the URL of your self-hosted license server. For more information, see the NVIDIA License Server Release Notes web page.
11.2.1. Building a custom GPU overcloud image リンクのコピーリンクがクリップボードにコピーされました!
Perform the following steps on the director node to install the NVIDIA GRID host driver on an overcloud Compute image and upload the image to the OpenStack Image service (glance).
Procedure
Copy the overcloud image and add the
gpu
suffix to the copied image.cp overcloud-full.qcow2 overcloud-full-gpu.qcow2
$ cp overcloud-full.qcow2 overcloud-full-gpu.qcow2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install an ISO image generator tool from YUM.
sudo yum install genisoimage -y
$ sudo yum install genisoimage -y
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Download the NVIDIA GRID host driver RPM package that corresponds to your GPU device from the NVIDIA website. To determine which driver you need, see the NVIDIA Driver Downloads Portal.
注記You must be a registered NVIDIA customer to download the drivers from the portal.
Create an ISO image from the driver RPM package and save the image in the
nvidia-host
directory.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a driver installation script that also disables the nouveau driver and generates a new initramfs. The following example script,
install_nvidia.sh
, disables the nouveau driver, generates a new initramfs, and installs the NVIDIA GRID host driver on the overcloud image:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<host_driver>
with the host driver downloaded in step 3.
-
Replace
Customize the overcloud image by attaching the ISO image that you generated in step 4, and running the driver installation script that you created in step 5:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Relabel the customized image with SELinux:
virt-customize -a overcloud-full-gpu.qcow2 --selinux-relabel
$ virt-customize -a overcloud-full-gpu.qcow2 --selinux-relabel [ 0.0] Examining the guest ... [ 2.2] Setting a random seed [ 2.2] SELinux relabelling [ 27.4] Finishing off
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Prepare the custom image files for upload to the OpenStack Image Service:
mkdir /var/image/x86_64/image guestmount -a overcloud-full-gpu.qcow2 -i --ro image cp image/boot/vmlinuz-3.10.0-862.14.4.el8.x86_64 ./overcloud-full-gpu.vmlinuz cp image/boot/initramfs-3.10.0-862.14.4.el8.x86_64.img ./overcloud-full-gpu.initrd
$ mkdir /var/image/x86_64/image $ guestmount -a overcloud-full-gpu.qcow2 -i --ro image $ cp image/boot/vmlinuz-3.10.0-862.14.4.el8.x86_64 ./overcloud-full-gpu.vmlinuz $ cp image/boot/initramfs-3.10.0-862.14.4.el8.x86_64.img ./overcloud-full-gpu.initrd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow From the undercloud, upload the custom image to the OpenStack Image Service:
(undercloud) $ openstack overcloud image upload --update-existing --os-image-name overcloud-full-gpu.qcow2
(undercloud) $ openstack overcloud image upload --update-existing --os-image-name overcloud-full-gpu.qcow2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow