Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ Cloud Container Engine/ User Guide/ Scheduling/ GPU Scheduling/ GPU Driver Version/ Manually Upgrading the Driver Version of a GPU Node

Manually Upgrading the Driver Version of a GPU Node

Updated on 2025-02-18 GMT+08:00

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.

NOTE:

Upgrading the driver version of a GPU node manually is a short-term fix for customizing node configurations. However, once the node is restarted, the driver version will revert back to the version specified in the GPU add-on configuration.

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.

Prerequisites

The cluster can be accessed using kubectl. For details, see Connecting to a Cluster Using kubectl.

Procedure

To use a specific NVIDIA driver version, perform the following operations to install the GPU driver of the latest version on the node:

  1. Take the node offline and manually evict pods on the node to prevent all programs from using GPUs.

    1. Take the node offline.
      kubectl cordon <NODE_NAME>

      After the node is offline, it becomes unschedulable.

      NAME            STATUS                     ROLES    AGE   VERSION
      192.168.1.xx    Ready,SchedulingDisabled   <none>   20m   v1.25.5-r20-25.1.31.1
    2. Manually evict pods on the node.
      kubectl drain 192.168.1.xx --ignore-daemonsets=true --delete-emptydir-data

      Expected result

      node/192.168.1.xx drained
    3. Check whether there are any DaemonSet pods are using GPUs. If so, stop kubelet and the runtime.

      Log in to the node where the GPU driver needs to be upgraded, for example, the node with IP address 192.168.1.xx.

      • Stop containerd.
        systemctl stop kubelet kubelet-monit containerd containerd-monit
      • Stop Docker.
        systemctl stop kubelet kubelet-monit docker docker-monit
    4. Check whether there are any programs are using GPUs.

      Run the sudo fuser -v /dev/nvidia* command.

      If this command is unavailable (for example, in an RPM-based Linux distribution), run the yum install psmisc command to install the Psmisc package.
      # 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
      Run the sudo kill 12192 command to delete the process. In this example, process ID 12192 is for reference only.
      # sudo kill 12192
      # sudo fuser -v /dev/nvidia*      # Recheck whether there are any programs are using GPUs.

  2. Install the NVIDIA driver of a specified version on the node.

    1. Download the driver of the specified version at the official NVIDIA website. For details about how to select a proper driver version, see Selecting a GPU Driver Version for Nodes.
    2. Record the driver information of the current version. The command for obtaining a driver varies depending on the CCE AI Suite (NVIDIA GPU) add-on version.
      • Version 1.x.x: /opt/cloud/cce/nvidia/bin/nvidia-smi
      • Versions from 2.0.0 to 2.5.3: /usr/local/nvidia/bin/nvidia-smi
      • Versions later than 2.5.4: nvidia-smi
      # nvidia-smi
      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                                                 |
      +-----------------------------------------------------------------------------+
    3. Prepare for the installation.
      Obtain the kernel version of the current node and install its dependencies (such as gcc, make, and kernel-devel). The following is an example using a RPM-based Linux distribution (whose OS is EulerOS, HCE, or CentOS).
      yum install -y perl kernel-devel-$(uname -r) zlib-devel binutils binutils-extra binutils-devel elfutils-libelf-devel gcc make
    4. Install the downloaded driver and verify the installation.
      The NVIDIA-Linux-x86_64-535.54.03.run driver is used as an example.
      # 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"
      NOTE:

      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:

      1. Disable kubelet and the runtime.
        • Disable containerd.
          systemctl disable kubelet kubelet-monit containerd containerd-monit
        • Disable Docker.
          systemctl disable kubelet kubelet-monit docker docker-monit
      2. Restart the affected node.
      3. Run the driver installation command again.
      4. Enable kubelet and the runtime.
        • Enable containerd.
          systemctl enable kubelet kubelet-monit containerd containerd-monit
        • Enable Docker.
          systemctl enable kubelet kubelet-monit docker docker-monit
    5. Run the nvidia-smi command to check whether the new-version GPU driver has been installed.
      # nvidia-smi
      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                                                           |
      +---------------------------------------------------------------------------------------+
    6. Delete driver files and historical commands.
      rm NVIDIA-Linux-x86_64-535.54.03.run /root/nvidia-installer.log && history -c

  3. Restart the node.

    1. Restart kubelet and the runtime.
      • Restart containerd.
        systemctl start kubelet kubelet-monit containerd containerd-monit
      • Restart Docker.
        systemctl start kubelet kubelet-monit docker docker-monit
    2. Remove scheduling restrictions on the node.
      kubectl uncordon <NODE_NAME>

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback