tencent cloud

Manually Installing Tesla Driver - Linux
Last updated:2025-06-09 12:05:47
Manually Installing Tesla Driver - Linux
Last updated: 2025-06-09 12:05:47

Application Scenario

To ensure the Cloud GPU Service to work properly, the correct Data Center Operating System software must be installed in advance. For NVIDIA series GPUs, the following two levels of software packages need to be installed:
The hardware driver that drives the GPU to work.
The libraries required by upper-level applications.
If you use NVIDIA GPUs for general computing, you need to install the Tesla Driver along with CUDA. This document explains how to install the Tesla Driver. For instructions on installing CUDA, see Installing CUDA Driver.
Note:
NVIDIA GPU instances are categorized into two types: physical pass-through card instances (full GPUs) and vGPU instances (fractional GPUs, such as 1/4 GPU).
Physical passthrough GPUs can use the Tesla driver to support computing scenarios or the GRID driver to enable rendering scenarios.
vGPUs can only use specific versions of the GRID driver to support different scenarios.

Directions

Linux Driver Installation

The Linux driver installation uses Shell scripts and is compatible with all Linux release versions, including TencentOS and Ubuntu.
The installation of NVIDIA Tesla GPU drivers on Linux requires compiling the kernel module. The system should have GCC and the packages needed to compile the Linux kernel module pre-installed, such as kernel-devel-$(uname -r). This document provides the guide for TencentOS and Ubuntu systems. Select based on your requirements:
TencentOS Server 2.4
TencentOS Server 3.1
Ubuntu
1. Execute the following command to check whether dkms is installed in the current system.
rpm -q dkms
If the returned result is as follows, the dkms has been installed.

If the dkms is not installed, execute the following command to install it.
sudo yum install -y dkms
2. Log in to the NVIDIA Driver Download page.
3. Select the corresponding series based on the instance operating system and instance type. For details on instance specifications, see Instance Types. This document uses the V100 as an example, as shown in the figure below:
Note:
Selecting Linux 64-bit indicates that you are downloading the shell installation file.

4. Click Find to look up the driver, and select the desired driver version to download.

5. 
Select the specific version and click View to enter the download page.
Then copy the link address of the Download button, as shown in the figure below:

6. See Logging In To Linux Instance (Web Shell) to log in to the GPU instance.
7. Use the wget command and paste the link address copied in Step 5 to download the installation package. Replace xxxx in the command with the link address you copied.
wget xxxx
8. Execute the following command to modify the installation package permissions. Replace xxxx in the command with the actual version number of your driver.
chmod +x NVIDIA-Linux-x86_64-xxxx.run
9. Since the installation of the NVIDIA driver requires kernel-devel and kernel-headers, run the following commands in sequence to check whether these packages are installed on the current system. Ensure that their versions match the current kernel version.
rpm -qa |grep -i kernel
If the returned result is as shown below, it indicates that both kernel-devel and kernel-headers have been installed.

If the output does not include kernel-devel-* and kernel-headers-* matching the current kernel version, you will need to manually install the corresponding kernel-devel and kernel-headers packages for that kernel version.
sudo yum install -y kernel-headers-$(uname -r).tl2.x86_64 kernel-devel-$(uname -r).tl2.x86_64
10. Upgrade the GCC version. The default GCC version in TencentOS 2.4 is 4.8.5, but GCC 8 is required to compile the NVIDIA kernel module.
Run the following command to check the GCC version:
gcc --version
As shown in the figure below, the GCC version is 4.8.5.

See the steps below to install GCC 8 using SCL (Software Collection). SCL allows you to build and install multiple versions of the same component on your system without affecting the system version of packages installed from the distribution.
sudo yum -y install tlinux-release-scl #Install the SCL repository for TencentOS.
sudo yum -y install devtoolset-8-gcc #Install GCC 8 provided by SCL.
sudo scl enable devtoolset-8 bash #Activate GCC provided by SCL.
sudo gcc --version #Check the GCC version.
11. Run the following command to install the driver, and proceed according to the prompts. Replace xxxx in the command with your actual driver version number.
sudo sh NVIDIA-Linux-x86_64-xxxx.run --ui=none --disable-nouveau --no-install-libglvnd --dkms --no-cc-version-check -s
12. After the installation is completed, run the following command to verify the installation. If GPU information is returned, the driver has been successfully installed.
nvidia-smi
13. Regenerate the initramfs.
dracut -f
1. Execute the following command to check whether dkms is installed in the current system.
rpm -q dkms
If the returned result is as follows, the dkms has been installed.

If the dkms is not installed, execute the following command to install it.
sudo yum install -y dkms
2. Log in to the NVIDIA Driver Download page.
3. Select the corresponding series based on the instance operating system and instance type. For details on instance specifications, see Instance Types. This document uses the V100 as an example, as shown in the figure below:
Note:
Selecting Linux 64-bit indicates that you are downloading the shell installation file.

4. Click Find to look up the driver, and select the desired driver version to download.

5. 
Select the specific version and click View to enter the download page.
Then copy the link address of the Download button, as shown in the figure below:

6. See Logging In To Linux Instance (Web Shell) to log in to the GPU instance.
7. Use the wget command and paste the link address copied in Step 5 to download the installation package. Replace xxxx in the command with the link address you copied.
wget xxxx
8. Execute the following command to modify the installation package permissions. Replace xxxx in the command with the actual version number of your driver.
chmod +x NVIDIA-Linux-x86_64-xxxx.run
9. Since the installation of the NVIDIA driver requires kernel-devel and kernel-headers, run the following commands in sequence to check whether these packages are installed on the current system. Ensure that their versions match the current kernel version.
rpm -q |grep -i kernel
If the returned result is as shown below, it indicates that both kernel-devel and kernel-headers have been installed.

If the output does not include kernel-devel-* and kernel-headers-* matching the current kernel version, you will need to manually install the corresponding kernel-devel and kernel-headers packages for that kernel version.
sudo yum install -y kernel-headers-$(uname -r).tl3.x86_64 kernel-devel-$(uname -r).tl3.x86_64
10. Run the following command to install the driver, and proceed according to the prompts. Replace xxxx in the command with your actual driver version number.
sudo sh NVIDIA-Linux-x86_64-xxxx.run --ui=none --disable-nouveau --no-install-libglvnd --dkms --no-cc-version-check -s
11. After the installation is completed, run the following command to verify the installation. If GPU information is returned, the driver has been successfully installed.
nvidia-smi
12. Regenerate the initramfs.
dracut -f
13. Enable persistent mode.
sudo nvidia-persistenced
1. Execute the following command to check whether dkms is installed in the current system.
dpkg -l | grep -i dkms
If the returned result is as follows, the dkms has been installed.

If the returned result is empty, it indicates that DKMS is not installed. Run the following command to install it.
sudo apt-get install dkms -y
2. Log in to the NVIDIA Driver Download page.
3. Select the corresponding series based on the instance operating system and instance type. For details on instance specifications, see Instance Types. This document uses the V100 as an example, as shown in the figure below:
Note:
Selecting Linux 64-bit indicates that you are downloading the shell installation file.

4. Click Find to look up the driver, and select the desired driver version to download.

5. 
Select the specific version and click View to enter the download page.
Then copy the link address of the Download button, as shown in the figure below:

6. See Logging In To Linux Instance (Web Shell) to log in to the GPU instance.
7. Use the wget command and paste the link address copied in Step 5 to download the installation package. Replace xxxx in the command with the link address you copied.
wget xxxx
8. Execute the following command to modify the installation package permissions. Replace xxxx in the command with the actual version number of your driver.
chmod +x NVIDIA-Linux-x86_64-xxxx.run
9. Since the installation of the NVIDIA driver depends on gcc and linux-kernel-headers, run the following commands in sequence to check whether gcc and kernel-devel are installed on the current system.
dpkg -l | grep -i gcc
dpkg -l | grep -i linux-headers
If the returned result is as follows, gcc and kernel-devel have been installed.

If the command returns no result, it indicates that the packages are not installed. Execute the following command to install it.
sudo apt-get install gcc linux-headers-$(uname -r) -y
10. Install libgl1-mesa-glx.
sudo apt install libgl1-mesa-glx -y
11. Run the following command to install the driver, and proceed according to the prompts. Replace xxxx in the command with your actual driver version number.
sudo sh NVIDIA-Linux-x86_64-xxxx.run --ui=none --disable-nouveau --no-install-libglvnd --dkms --no-cc-version-check -s
12. After the installation is completed, run the following command to verify the installation. If GPU information is returned, the driver has been successfully installed.
nvidia-smi
13. Update the initramfs.
sudo update-initramfs -u
14. Enable persistent mode.
sudo nvidia-persistenced

Reasons for Installation Failure

The failure of Linux system driver installation is manifested as nvidia-smi not working. The common reasons are as follows:
1. The system lacks the necessary packages for compiling the kernel module, such as gcc and kernel-devel-xxx, resulting in a failure to compile and complete the installation.
2. There are multiple versions of kernel in the system. Due to incorrect configuration of DKMS, the driver is compiled into a kernel module that is not the current version of kernel, resulting in kernel module installation failure.
3. After the driver is installed, the kernel version was upgraded, causing the original installation to become invalid.
4. Verify whether the nouveau driver is installed. If it is installed, it needs to be uninstalled.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback