Manually Installing a Tesla Driver on a GPU-accelerated ECS
Scenarios
To enable compute acceleration on a GPU-accelerated ECS, you must install the Tesla driver and CUDA Toolkit.
- A computing-accelerated (P series) ECS created using a public image comes with a specific version of the Tesla driver preinstalled by default.
- If a GPU-accelerated ECS is created using a private image, you must install the Tesla driver and CUDA Toolkit to enable compute acceleration.
This section describes how to install the Tesla driver and CUDA Toolkit on a GPU-accelerated ECS manually.
Constraints
- The GPU driver can be installed only on GPU-accelerated ECSs. For details about GPU-accelerated ECSs and their application scenarios, see GPU-accelerated ECSs.
- An EIP must be bound to the ECS.
- The Tesla driver and CUDA Toolkit have not been installed on the ECS.
- When you download the CUDA Toolkit from the NVIDIA official website, a Tesla driver that matches the CUDA version is usually installed automatically, eliminating the need to install the driver separately. However, if there are specific requirements or dependencies on the Tesla driver version, download the matching Tesla driver from the official NVIDIA website and install the driver first before installing the CUDA Toolkit.
- If a Tesla driver has been installed on the ECS, check whether the driver version is available. If you need to install a new driver version, uninstall the old Tesla driver first to prevent installation failures caused by driver conflicts.
- Table 1 lists the relationship between ECS series and Tesla drivers.
Installing the Tesla Driver and CUDA Toolkit on a Linux ECS
The following describes how to install the Tesla driver corresponding to CUDA 10.1 and install CUDA 10.1 using the .run package on a GPU ECS running Ubuntu 20.04 64-bit.
The Linux kernel version must match the driver version. If driver installation fails, check the driver installation log, which is generally stored in /var/log/nvidia-installer.log. If the log shows that the failure was caused by a driver compilation error, for example, the get_user_pages parameter setting is incorrect, the kernel version is incompatible with the driver version. In such a case, select the desired kernel version and driver version and reinstall them. It is recommended that the release time of the kernel version and driver version be the same.
Installing the Tesla Driver
- Log in to the ECS.
- Update the system software based on the OS.
- Ubuntu
Update the software package repositories: apt-get -y update
Install necessary programs: apt-get install gcc g++ make
- CentOS
Update the software package repositories: yum -y update --exclude=kernel* --exclude=centos-release* --exclude=initscripts*
Install necessary programs: yum install -y kernel-devel-`uname -r` gcc gcc-c++
- Ubuntu
- Download the NVIDIA driver package.
Download a driver from NVIDIA Drivers based on the ECS series.
Figure 1 Manual driver search
- Select a driver version as required. The following uses Tesla 418.67 as an example. Figure 2 Selecting a driver version
- Click View in the row containing the driver to be downloaded.
- Right-click Download and copy the download URL.
- Run the following command on the ECS to download the driver:
wget {URL-for-downloading-the-NVIDIA-driver}
For example, wget http://us.download.nvidia.com/tesla/418.67/NVIDIA-Linux-x86_64-418.67.run
Figure 3 Obtaining the installation package
You can run the wget {URL for downloading the NVIDIA driver} command to download the NVIDIA driver.
If the error message "403: Forbidden" is displayed after the command is executed, run the following command to download the driver:
wget -U "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36" --referer="https://www.nvidia.com/" {URL for downloading the NVIDIA driver}
- Run the following command to install the driver:
- (Optional) If the following information is displayed after the command for installing the driver is executed, disable the Nouveau driver. Figure 4 Disabling the Nouveau driver
- Run the following command to check whether the Nouveau driver has been installed:
- Edit the blacklist.conf file.
If the /etc/modprobe.d/blacklist.conf file was not found, create one.
vi /etc/modprobe.d/blacklist.conf
Add the following content to the end of the file:
blacklist nouveau options nouveau modeset=0
- Back up the current initramfs and generate a new one.
- Run the following command to restart the ECS:
reboot
- Select OK for three consecutive times as prompted to complete the driver installation. Figure 5 Completing the NVIDIA driver installation
- Run the following command to set systemd:
- Run the reboot command to restart the ECS.
- Log in to the ECS and run the nvidia-smi command. If the command output contains the installed driver version, the driver has been installed. Figure 6 Viewing the NVIDIA driver version
Installing the CUDA Toolkit
- Log in to the ECS.
- Update the system software based on the OS.
- Ubuntu
Update the software installation source: apt-get -y update
Install necessary programs: apt-get install gcc g++ make
- CentOS
Update the software installation source: yum -y update --exclude=kernel* --exclude=centos-release* --exclude=initscripts*
Install the desired program: yum install -y kernel-devel-`uname -r` gcc gcc-c++
- Ubuntu
- On the CUDA download page, set parameters based on the information provided in Obtaining a Tesla Driver and CUDA Toolkit. Figure 7 Selecting a CUDA version
- View the URL for downloading CUDA 10.1 corresponding to Ubuntu 20.04 64-bit and copy the URL.
- Run the following command on the ECS to download CUDA:
wget copied-URL
For example, wget https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.39_linux.run
Figure 8 Downloading CUDA
- Install CUDA.
Follow the instructions provided on the official NVIDIA website.
- Run the following command to install CUDA:
- Select accept on the installation page and press Enter. Figure 9 Installing CUDA_1
- Select Install and press Enter to start the installation. Figure 10 Installing CUDA_2
Figure 11 Completing the installation
- (Optional) Check whether CUDA has been installed. If the CUDA version is 11.5 or earlier, perform the following operations to check whether CUDA has been installed. If the CUDA version is 11.6 or later, skip this step.
- Run the following command to switch to /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery:
cd /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery
- Run the make command to automatically compile the deviceQuery program.
- Run the following command to check whether CUDA has been installed:
If the command output contains the CUDA version, CUDA has been installed.
Figure 12 deviceQuery common output
- Run the following command to switch to /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery:
- Check the CUDA version. Figure 13 Checking the CUDA version
- Run the following command to enable the persistent mode:
Enabling the persistent mode optimizes the GPU performance on Linux ECSs.
Installing the Tesla Driver and CUDA Toolkit on a Windows ECS
The following describes how to install the Tesla driver and CUDA 10.1 on a GPU ECS running Windows Server 2016 Standard 64-bit.
Installing the Tesla Driver
- Log in to the ECS.
- Download the NVIDIA driver package.
Select a driver version at NVIDIA Drivers based on the ECS series.
Figure 14 Selecting a driver type (Windows)
- Select a driver version as required. The following uses Tesla 425.25 as an example. Figure 15 Selecting a driver version (Windows)
- Click View in the row containing the driver to be downloaded.
- Click Download to download the installation package.
- Double-click the driver and click Run. Figure 16 Running the NVIDIA driver installation program
- Select an installation path and click OK. Figure 17 Selecting an installation path
- Install the NVIDIA program as prompted. Figure 18 Completing the driver installation
- Restart the ECS.
- Check whether the NVIDIA driver has been installed.
- Switch to Device Manager and click Display adapters. Figure 19 Display adapters
- Open the cmd window on the ECS and run the following commands:
cd C:\Program Files\NVIDIA Corporation\NVSMI
nvidia-smi
If the command output contains the installed driver version, the driver has been installed.
Figure 20 Viewing the NVIDIA driver version
- Switch to Device Manager and click Display adapters.
Installing the CUDA Toolkit
- Log in to the ECS.
- On the CUDA download page, set parameters based on the information provided in Obtaining a Tesla Driver and CUDA Toolkit. Figure 21 Selecting a CUDA version
- View the URL for downloading CUDA 10.1 corresponding to Windows Server 2016 Standard 64-bit. Figure 22 URL for downloading CUDA
- Click Download to download the CUDA Toolkit.
- Double-click the installation file and click Run to install the CUDA Toolkit. Figure 23 Installing CUDA on a Windows ECS
- On the CUDA Setup Package page, select an installation path and click OK. Figure 24 Selecting an installation path
- Follow the prompts to install the CUDA Toolkit. Figure 25 CUDA installation completed
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
