All Products
Search
Document Center

:Install the Tesla driver, CUDA, and cuDNN on the RDS Custom AI node

Last Updated:Jul 19, 2025

When you create an RDS Custom AI node, the system installs the NVIDIA Tesla driver, CUDA, and cuDNN by default. If the default versions of these components no longer meet your requirements, you can uninstall the existing versions and install the versions you need.

Prerequisites

An RDS Custom AI node instance is created

Uninstall the Tesla driver, CUDA, and cuDNN

This topic uses the installation of Tesla driver 575.57.08, CUDA 12.9.0, and cuDNN 9.10.2 on Alibaba Cloud Linux 3 as an example. The procedure is as follows:

  1. Connect to the RDS Custom instance.

  2. Run the following command and follow the interface prompts to uninstall the Tesla driver.

    /usr/bin/nvidia-uninstall
  3. Uninstall CUDA.

    Method 1: Manually delete the CUDA package and related configuration files

    1. Manually delete the CUDA package and related configurations.

      # Uninstall CUDA packages
      sudo dnf remove 'cuda*'
      
      # Delete repository configurations
      sudo rm /etc/yum.repos.d/cuda*.repo
      
      # Clean cache
      sudo dnf clean all
    2. Run the nvcc --version command to confirm whether CUDA is uninstalled.

      When the prompt command not found appears, CUDA is successfully uninstalled.

    Method 2: Uninstall using the uninstall_cuda file

    Note

    Different CUDA versions may have different uninstall commands. If the cuda-uninstaller file is not found, check whether a file starting with uninstall_cuda exists in the /usr/local/cuda/bin/ directory.

    • If it exists, replace cuda-uninstaller in the command with that file name.

    • If it does not exist, uninstall using Method 1.

    /usr/local/cuda/bin/cuda-uninstaller
    rm -rf /usr/local/cuda-12.9

    When Successfully appears in the output, the uninstallation is successful.

  4. Uninstall cuDNN.

    1. Run the following command to check the names of the installed cuDNN-related packages.

      rpm -qa | grep cudnn

      The following result is returned:

      cudnn9-cuda-12-9.10.2.21-1.x86_64
      libcudnn9-cuda-12-9.10.2.21-1.x86_64
      libcudnn9-static-cuda-12-9.10.2.21-1.x86_64
      ...
    2. Run the dnf remove command to uninstall each target package.

      sudo dnf remove cudnn9-cuda-12-9.10.2.21-1.x86_64
      sudo dnf remove libcudnn9-cuda-12-9.10.2.21-1.x86_64
      sudo dnf remove libcudnn9-static-cuda-12-9.10.2.21-1.x86_64
    3. Run the following command to clean up remaining dependencies.

      sudo dnf autoremove
    4. Verify the uninstallation result.

      rpm -qa | grep cudnn

      If the output is empty, the uninstallation is successful. Otherwise, continue to run dnf remove to uninstall the remaining packages.

Install the Tesla driver

Step 1: Download the NVIDIA Tesla driver

  1. Visit the NVIDIA driver download page.

    Note

    For more information about installing and configuring NVIDIA drivers, see NVIDIA Driver Installation Quickstart Guide.

  2. Set the appropriate search criteria based on the RDS Custom instance type to find and select a suitable driver.

  3. Find the driver you want to download and click View next to the corresponding driver.

  4. On the product page of the driver you want to download, right-click Download and copy the link address.

  5. Connect to the RDS Custom instance.

  6. Run the following command to download the driver installation package.

    The driver download URL in the example command is the driver download link you obtained in Step 4.

    wget https://us.download.nvidia.com/tesla/575.57.08/NVIDIA-Linux-x86_64-575.57.08.run

Step 2: Install the NVIDIA Tesla driver

Alibaba Cloud Linux/CentOS

  1. Run the following command to check whether the kernel-devel and kernel-headers packages are installed on the GPU-accelerated instance.

    sudo rpm  -qa | grep $(uname -r)
    • If the command output includes the version information about the kernel-devel and kernel-headers packages, the packages are installed. Sample command output:

      kernel-3.10.0-1062.18.1.el7.x86_64
      kernel-devel-3.10.0-1062.18.1.el7.x86_64
      kernel-headers-3.10.0-1062.18.1.el7.x86_64
    • If you cannot find kernel-devel-* and kernel-headers-* in the command output, you need to download and install the kernel-devel and kernel-headers packages that match your kernel version.

      Important

      If the kernel-devel version is different from the kernel version, a compilation error occurs when you install RPM Package Manager (RPM) for your driver. Therefore, check the version number of kernel-* in the command output before you download the corresponding kernel-devel version. In the preceding command output, the kernel version is 3.10.0-1062.18.1.el7.x86_64.

  2. Grant the permissions on the installation package to your Tesla driver and install the driver.

    In this example, a Linux 64-bit Tesla driver is used. We recommend that you use a .run installation package for your Tesla driver, such as the NVIDIA-Linux-x86_64-xxxx.run package. Run the following commands to grant the execution permissions on the installation package and install the Tesla driver.

    Note

    If you use a Tesla driver in other formats such as .deb or .rpm, see NVIDIA CUDA Installation Guide for Linux for the specific installation method.

    # Grant permissions
    sudo chmod +x NVIDIA-Linux-x86_64-xxxx.run
    # Install
    sudo sh NVIDIA-Linux-x86_64-xxxx.run
  3. Run the following command to check whether the Tesla driver is installed:

    nvidia-smi

    When the detailed information of the Tesla driver appears in the output, the installation is successful.

    image

  4. (Optional) Enable Persistence-M using the NVIDIA Persistence Daemon.

    After the Tesla driver is installed, Persistence-M is disabled (off) by default. The Tesla driver is more stable when Persistence-M is enabled. To ensure business continuity, we recommend that you enable Persistence-M using the NVIDIA Persistence Daemon. For more information, see Persistence Daemon.

    Note
    1. Run the following command to run the NVIDIA Persistence Daemon:

      sudo nvidia-persistenced --user username 
      # username is your username.
    2. Run the following command to view the status of Persistence-M:

      nvidia-smi

      If the following command output is displayed, Persistence-M is enabled (on).

      image

  5. (Optional) Enable Persistence-M after the system is restarted.

    If the system is restarted, Persistence-M will be disabled (on). You can perform the following operations to re-enable Persistence-M.

    By installing the Tesla driver installation package, the installation script provided by NVIDIA (such as sample scripts and installer scripts) is installed to the /usr/share/doc/NVIDIA_GLX-1.0/samples/nvidia-persistenced-init.tar.bz2 path.

    1. Run the following commands to decompress and install the installation script provided by NVIDIA:

      cd /usr/share/doc/NVIDIA_GLX-1.0/samples/
      sudo tar xf nvidia-persistenced-init.tar.bz2
      cd nvidia-persistenced-init
      sudo sh install.sh
    2. Run the following command to check whether the NVIDIA Persistence Daemon runs as expected:

      sudo systemctl status nvidia-persistenced

      If the following command output is displayed, the NVIDIA Persistence Daemon runs as expected.

      image

      Note

      You can adapt the NVIDIA Persistence Daemon installation script based on your operating system to ensure that the NVIDIA Persistence Daemon works as expected.

    3. Run the following command to confirm that Persistence-M is enabled (on) again.

      nvidia-smi
    4. (Optional) Run the following command to disable the NVIDIA Persistence Daemon.

      You can disable the NVIDIA Persistence Daemon as needed.

      sudo systemctl stop nvidia-persistenced
      sudo systemctl disable nvidia-persistenced

Ubuntu and others

  1. Grant the permissions on the installation package to your Tesla driver and install the driver.

    In this example, a Linux 64-bit Tesla driver is used. We recommend that you use a .run installation package for your Tesla driver, such as the NVIDIA-Linux-x86_64-xxxx.run package. Run the following commands to grant the execution permissions on the installation package and install the Tesla driver.

    Note

    If you use a Tesla driver in other formats such as .deb or .rpm, see NVIDIA CUDA Installation Guide for Linux for the specific installation method.

    # Grant permissions
    sudo chmod +x NVIDIA-Linux-x86_64-xxxx.run
    # Install
    sudo sh NVIDIA-Linux-x86_64-xxxx.run
  2. Run the following command to check whether the Tesla driver is installed:

    nvidia-smi

    When the detailed information of the Tesla driver appears in the output, the installation is successful.

    image

  3. (Optional) Enable Persistence-M using the NVIDIA Persistence Daemon.

    After the Tesla driver is installed, Persistence-M is disabled (off) by default. The Tesla driver is more stable when Persistence-M is enabled. To ensure business continuity, we recommend that you enable Persistence-M using the NVIDIA Persistence Daemon. For more information, see Persistence Daemon.

    Note
    1. Run the following command to run the NVIDIA Persistence Daemon:

      sudo nvidia-persistenced --user username 
      # username is your username.
    2. Run the following command to view the status of Persistence-M:

      nvidia-smi

      If the following command output is displayed, Persistence-M is enabled (on).

      image

  4. (Optional) Enable Persistence-M after the system is restarted.

    If the system is restarted, Persistence-M will be disabled (on). You can perform the following operations to re-enable Persistence-M.

    By installing the Tesla driver installation package, the installation script provided by NVIDIA (such as sample scripts and installer scripts) is installed to the /usr/share/doc/NVIDIA_GLX-1.0/samples/nvidia-persistenced-init.tar.bz2 path.

    1. Run the following commands to decompress and install the installation script provided by NVIDIA:

      cd /usr/share/doc/NVIDIA_GLX-1.0/samples/
      sudo tar xf nvidia-persistenced-init.tar.bz2
      cd nvidia-persistenced-init
      sudo sh install.sh
    2. Run the following command to check whether the NVIDIA Persistence Daemon runs as expected:

      sudo systemctl status nvidia-persistenced

      If the following command output is displayed, the NVIDIA Persistence Daemon runs as expected.

      image

      Note

      You can adapt the NVIDIA Persistence Daemon installation script based on your operating system to ensure that the NVIDIA Persistence Daemon works as expected.

    3. Run the following command to confirm that Persistence-M is enabled (on) again.

      nvidia-smi
    4. (Optional) Run the following command to disable the NVIDIA Persistence Daemon.

      You can disable the NVIDIA Persistence Daemon as needed.

      sudo systemctl stop nvidia-persistenced
      sudo systemctl disable nvidia-persistenced

Install CUDA

  1. Obtain the CUDA installation package.

    1. Go to the CUDA Toolkit Archive page.

    2. Click the CUDA version that corresponds to your driver.

    3. In Operating System, select the operating system, architecture, or version parameters as needed to obtain the download URL and installation commands for the corresponding CUDA installation package.

      Note

      This topic uses CUDA 12.9.0 and the Linux operating system RHEL 8 (Alibaba Cloud Linux 3 is compatible with RHEL 8) as an example.

  2. Install CUDA.

    1. Connect to the RDS Custom instance.

    2. Run the following commands in sequence to install CUDA.

      wget https://developer.download.nvidia.com/compute/cuda/12.9.0/local_installers/cuda-repo-rhel8-12-9-local-12.9.0_575.51.03-1.x86_64.rpm
      sudo rpm -i cuda-repo-rhel8-12-9-local-12.9.0_575.51.03-1.x86_64.rpm
      sudo dnf clean all
      sudo dnf -y install cuda-toolkit-12-9
    3. Run the following commands in sequence to configure CUDA environment variables:

      echo 'export PATH=/usr/local/cuda/bin:$PATH' | sudo tee /etc/profile.d/cuda.sh
      source /etc/profile
  3. Check whether CUDA is installed on the instance.

    Run the nvcc -V command to check whether the CUDA installation version is correct.

    The following result is returned:

    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2025 NVIDIA Corporation
    Built on Wed_Apr__9_19:24:57_PDT_2025
    Cuda compilation tools, release 12.9, V12.9.41
    Build cuda_12.9.r12.9/compiler.35813241_0

Install cuDNN

  1. Obtain the cuDNN installation package.

    1. Go to the CUDA Deep Neural Network (cuDNN) | NVIDIA Developer page.

    2. Click Download cuDNN Library.

    3. In Operating System, select the operating system, architecture, or version parameters as needed to obtain the download URL and installation commands for the corresponding cuDNN installation package.

      The latest version of cuDNN is downloaded by default. You can also click Archive of Previous Releases to select and download the version you need.

      Note

      This topic uses cuDNN 9.10.2 and the Linux operating system RHEL 8 (Alibaba Cloud Linux 3 is compatible with RHEL 8) as an example.

  2. Install cuDNN.

    1. Connect to the RDS Custom instance.

    2. Run the following commands in sequence to install cuDNN.

      wget https://developer.download.nvidia.com/compute/cudnn/9.10.2/local_installers/cudnn-local-repo-rhel8-9.10.2-1.0-1.x86_64.rpm
      sudo rpm -i cudnn-local-repo-rhel8-9.10.2-1.0-1.x86_64.rpm
      sudo dnf clean all
      sudo dnf -y install cudnn-cuda-12
  3. (Optional) If the system installs cudnn.h, libcudnn.so*, and cudnn_version.h in the /usr/include/ directory by default, run the following commands to link these files to the corresponding directories under /usr/local/cuda/.

    1. Run the following commands to link libcudnn.so* and other cuDNN library files to /usr/local/cuda/lib64/.

      sudo ln -s /usr/lib64/libcudnn.so.9.10.2 /usr/local/cuda/lib64/libcudnn.so.9.10.2
      sudo ln -s /usr/local/cuda/lib64/libcudnn.so.9.10.2 /usr/local/cuda/lib64/libcudnn.so.9
      sudo ln -s /usr/local/cuda/lib64/libcudnn.so.9 /usr/local/cuda/lib64/libcudnn.so

      Run ls -l /usr/local/cuda/lib64/libcudnn.so* to verify the link result.

    2. Run the following commands to link cudnn.h and cudnn_version.h to /usr/local/cuda/include.

      sudo ln -s /usr/include/cudnn.h /usr/local/cuda/include/cudnn.h
      sudo ln -s /usr/include/cudnn_version.h /usr/local/cuda/include/cudnn_version.h

      Run ls -l /usr/local/cuda/include/cudnn* to verify the link result.

  4. Check whether cuDNN is successfully installed.

    cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

    The following result is returned:

    #define CUDNN_MAJOR 9
    #define CUDNN_MINOR 10
    #define CUDNN_PATCHLEVEL 2
    --

References

Introduction to RDS Custom