You can use the CCE AI Suite (NVIDIA GPU) add-on to configure the driver file path for a node. After the node is restarted, the driver will be installed automatically. Alternatively, manually upgrade the driver version.
Manually upgrading the driver version of a GPU node is a short-term fix for customizing node configurations. However, once the node is restarted, the driver version will revert to the version specified in the CCE AI Suite (NVIDIA GPU) settings.
For a stable, long-term upgrade of the driver version of a GPU node, see Upgrading the Driver Version of a GPU Node Using a Node Pool.
The cluster can be accessed using kubectl. For details, see Accessing a Cluster Using kubectl.
To use a specific NVIDIA driver version, perform the following operations to install the GPU driver of the latest version on the node:
kubectl cordon <NODE_NAME>
After the node goes offline, it will no longer support pod scheduling. You can verify this by running the following command:
kubectl get node <NODE_NAME>
If the following information is displayed, the node does not allow pod scheduling:
NAME STATUS ROLES AGE VERSION 192.168.1.xx Ready,SchedulingDisabled <none> 20m v1.25.5-r20-25.1.31.1
kubectl drain 192.168.1.xx --ignore-daemonsets=true --delete-emptydir-data
Expected result
node/192.168.1.xx drained
Log in to the node where the GPU driver needs to be upgraded, for example, the node with IP address 192.168.1.xx.
systemctl stop kubelet kubelet-monit containerd containerd-monit
systemctl stop kubelet kubelet-monit docker docker-monit
sudo fuser -v /dev/nvidia*
USER PID ACCESS COMMAND /dev/nvidia0: root 12192 F.... nvidia-gpu-devi /dev/nvidiactl: root 12192 F.... nvidia-gpu-devi
sudo kill 12192
sudo fuser -v /dev/nvidia* # Recheck if any program is using GPUs.
If no process is displayed in the command output, the detected processes have been evicted, and no program is using the GPUs.
/opt/cloud/cce/nvidia/bin/nvidia-smi
/usr/local/nvidia/bin/nvidia-smi
nvidia-smi
The execution results of the preceding three versions are basically the same. The command output is as follows:
Tue Feb 20 15:06:54 2024 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 470.141.03 Driver Version: 470.141.03 CUDA Version: 11.4 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Tesla V100-SXM2... Off | 00000000:21:01.0 Off | 0 | | N/A 31C P0 23W / 300W | 0MiB / 16160MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+
yum install -y perl kernel-devel-$(uname -r) zlib-devel binutils binutils-extra binutils-devel elfutils-libelf-devel gcc make
# Obtain the kernel version. kerVersion=`uname -r` # Logs for installation details touch /root/nvidia-installer.log # Install the driver downloaded at the official NVIDIA website. sh NVIDIA-Linux-x86_64-535.54.03.run --silent --kernel-source-path=/usr/src/kernels/$kerVersion --log-file-name=/root/nvidia-installer.log --no-install-compat32-libs --utility-prefix="/usr/local/nvidia" --opengl-prefix="/usr/local/nvidia"
If the following information is displayed during the installation:
ERROR: An NVIDIA kernel module 'nvidia' appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occurred that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer. ERROR: Installation has failed. Please see the file '/root/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
Perform the following operations to handle this issue:
systemctl disable kubelet kubelet-monit containerd containerd-monit
systemctl disable kubelet kubelet-monit docker docker-monit
systemctl enable kubelet kubelet-monit containerd containerd-monit
systemctl enable kubelet kubelet-monit docker docker-monit
/opt/cloud/cce/nvidia/bin/nvidia-smi
/usr/local/nvidia/bin/nvidia-smi
nvidia-smi
If the following information is displayed, the new version of the GPU driver has been installed:
Tue Feb 20 15:13:58 2024 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla V100-SXM2-16GB Off | 00000000:21:01.0 Off | 0 | | N/A 34C P0 38W / 300W | 0MiB / 16384MiB | 2% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | No running processes found | +---------------------------------------------------------------------------------------+
rm NVIDIA-Linux-x86_64-535.54.03.run /root/nvidia-installer.log && history -c
systemctl start kubelet kubelet-monit containerd containerd-monit
systemctl start kubelet kubelet-monit docker docker-monit
kubectl uncordon <NODE_NAME>