To use the full computing and graphics rendering power of a GPU-accelerated instance, install an NVIDIA Tesla driver. During instance creation, you can automate this with either a public image option or a User Data script — no manual setup required.
Installation methods
| Method | When to use | Details |
|---|---|---|
| Public image | Creating an instance through the console and want the simplest setup | Auto-install with a public image |
| User Data script | Skipping the Auto-install GPU Driver option, or need a custom driver version | Install with a User Data script |
Auto-install with a public image
Select a compatible public image and enable the Auto-install GPU Driver option. After the instance starts, the NVIDIA Tesla driver, CUDA, and cuDNN are installed automatically.
CUDA and cuDNN are installed together with the NVIDIA Tesla driver. For new instances, use the latest available driver, CUDA, and cuDNN versions.
Prerequisites
Before you begin, ensure that you have:
A GPU-accelerated instance type that supports automatic driver installation (see the compatibility table below)
Access to the Instance buy page
Compatibility
The following table lists supported instance types, public image versions, and corresponding driver versions.
ebmgn9g and ebmgn9ge do not support Ubuntu 22.04.
| Instance types | Supported public images | Tesla driver | CUDA | cuDNN |
|---|---|---|---|---|
| gn7e, gn7s, gn7i, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7e, ebmgn7i, ebmgn6v, ebmgn6i, ebmgn6e, ebmgn7ix, ebmgn7ex, gn8is, ebmgn8is, gn8ia, ebmgn8ia, gn8v, ebmgn8v, ebmgn9g, ebmgn9ge | Alibaba Cloud Linux 3, Ubuntu 24.04, Ubuntu 22.04 | 580.126.09 | 13.0.2 | 9.19.1.2 |
| gn7e, gn7s, gn7i, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7e, ebmgn7i, ebmgn6v, ebmgn6i, ebmgn6e, ebmgn7ix, ebmgn7ex, gn8is, ebmgn8is, gn8ia, ebmgn8ia, gn8v, ebmgn8v | Alibaba Cloud Linux 3, Ubuntu 24.04, Ubuntu 22.04, Ubuntu 20.04 | 580.126.09 | 12.8.1 | 9.19.1.2 |
| gn7e, gn7s, gn7i, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7e, ebmgn7i, ebmgn6v, ebmgn6i, ebmgn6e, gn8is, ebmgn8is, gn8v, ebmgn8v, gn8ia | Alibaba Cloud Linux 3, Ubuntu 24.04, Ubuntu 22.04, Ubuntu 20.04 (Note: ebmgn8v and ebmgn7e do not support Ubuntu 20.04) | 570.195.03 | 12.8.1 | 9.8.0.87 |
| gn7e, gn7s, gn7i, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7e, ebmgn7i, ebmgn6v, ebmgn6i, ebmgn6e, gn8is, ebmgn8is, gn8v, ebmgn8v, gn8ia | Alibaba Cloud Linux 3, Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04 (Note: ebmgn8v and ebmgn7e do not support Ubuntu 18.04) | 570.195.03 | 12.4.1 | 9.2.0.82 |
| gn7e, gn7s, gn7i, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7e, ebmgn7i, ebmgn6v, ebmgn6i, ebmgn6e, gn8is, ebmgn8is, gn8ia | Alibaba Cloud Linux 2, Alibaba Cloud Linux 3, Ubuntu 20.04, Ubuntu 18.04, CentOS 8.x, CentOS 7.x (Note: ebmgn7e does not support Ubuntu 18.04) | 535.216.03 | 12.1.1 | 8.9.7.29 |
| gn7i, gn7e, gn7s, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7, ebmgn7i, ebmgn7e, ebmgn6v, ebmgn6i, ebmgn6e | Alibaba Cloud Linux 2, Alibaba Cloud Linux 3, Ubuntu 20.04, Ubuntu 18.04, Ubuntu 16.04, CentOS 8.x, CentOS 7.x, Debian 10.10 (Note: ebmgn7e does not support Ubuntu 18.04 or Ubuntu 20.04) | 470.256.02 | 11.4.1 | 8.2.4 |
| gn7, gn7i, gn7e, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7, ebmgn7i, ebmgn7e, ebmgn6v, ebmgn6i, ebmgn6e | Alibaba Cloud Linux 2, Ubuntu 20.04, Ubuntu 18.04, Ubuntu 16.04, CentOS 8.x, CentOS 7.x | 460.91.03 | 11.2.2 | 8.1.1 |
| gn7, gn7e, gn6v, gn6i, gn6e, gn5, gn5i, ebmgn7, ebmgn7e, ebmgn6v, ebmgn6i, ebmgn6e | Alibaba Cloud Linux 2, Ubuntu 20.04, Ubuntu 18.04, Ubuntu 16.04, CentOS 8.x, CentOS 7.x | 460.91.03 | 11.0.2 | 8.1.1, 8.0.4 |
| gn6v, gn6i, gn6e, gn5, gn5i, ebmgn6v, ebmgn6i, ebmgn6e | Alibaba Cloud Linux 2, Ubuntu 18.04, Ubuntu 16.04, CentOS 8.x, CentOS 7.x | 460.91.03 | 10.2.89 | 8.1.1, 8.0.4, 7.6.5 |
| gn6v, gn6i, gn6e, gn5, gn5i, ebmgn6v, ebmgn6i, ebmgn6e | Ubuntu 18.04, Ubuntu 16.04, CentOS 7.x | 450.80.02, 440.64.00 | 10.1.168 | 8.0.4, 7.6.5, 7.5.0 |
| gn6v, gn6i, gn6e, gn5, gn5i, ebmgn6v, ebmgn6i, ebmgn6e | Ubuntu 18.04, Ubuntu 16.04, CentOS 7.x | 450.80.02, 440.64.00 | 10.0.130 | 7.6.5, 7.5.0, 7.4.2, 7.3.1 |
Steps
Go to the Instance buy page.
Select the Custom Launch tab.
Configure Billing Method, Region, Network and Zone, Instance Type, and Image. For details on all settings, see Configuration items.
After the instance is created or started, the following applies to the Tesla driver:
The automatic installation takes approximately 10 to 20 minutes. The actual time varies depending on the instance's internal network bandwidth and number of vCPUs. You can connect to the instance to monitor the installation progress. After the installation is complete, you can view the log file at /root/auto_install/auto_install.log. The following table describes the statuses displayed during installation.
Installation state
Displayed information
Installing
A progress bar is displayed.
Installation successful
The message ALL INSTALL OK is displayed.
Installation failed
The message INSTALL FAIL is displayed.
ImportantThe GPU is unavailable during the installation process. Do not perform any operations on the instance. If other GPU-related software is installed at the same time, the automatic installation may fail and make the instance unavailable.
In the Image section, on the Public Image tab, select a Linux operating system and version (for example, Alibaba Cloud Linux 3.2104 LTS 64-bit). Select the Auto-install GPU Driver checkbox, then choose the driver, CUDA, and cuDNN versions.

Follow the prompts to complete the purchase.
If you change the operating system after the instance is created, use a public image that supports automatic Tesla driver installation. If the image does not support this feature, disable it first. For details, see How do I disable automatic Tesla driver installation when changing the operating system?
If you install PyTorch 2.1.2 using
pip3 install torch, install CUDA 12.1. Using a different CUDA version causes a runtime error. For details, see The "undefined symbol: __nvJitLinkAddData_12_1, version libnvJitLink.so.12" error occurs when using PyTorch.
Monitor installation progress
Installation takes 10 to 20 minutes. The actual time varies depending on the instance's internal network bandwidth and vCPU count.
The GPU is unavailable during installation. Do not perform any operations on the instance. If other GPU-related software is installed concurrently, the automatic installation may fail and make the instance unavailable.
Connect to the instance to check progress. The log file is at /root/auto_install/auto_install.log.
| Status | Displayed information |
|---|---|
| Installing | A progress bar |
| Successful | ALL INSTALL OK |
| Failed | INSTALL FAIL |
Install with a User Data script
When creating an instance without the Auto-install GPU Driver option, provide an installation script in the User Data field. The script runs automatically when the instance first starts.
Script parameters
The script installs the Tesla driver, CUDA, and cuDNN using .run packages. Set the three version variables to match your instance type and image. Refer to the compatibility table for supported version combinations.
The following example sets the Tesla driver to 550.127.08, CUDA to 12.4.1, and cuDNN to 9.2.0.82:
DRIVER_VERSION="550.127.08"
CUDA_VERSION="12.4.1"
CUDNN_VERSION="9.2.0.82"Steps
Go to the Instance buy page.
Select the Custom Launch tab.
Configure Billing Method, Region, Network and Zone, Instance Type, and Image. For details on all settings, see Configuration items.
In the Advanced Settings (Optional) section, enter your installation script in the User Data field. The following is a sample script. Replace the version variables with values appropriate for your instance type and image.
#!/bin/sh # Set the versions to install DRIVER_VERSION="550.127.08" CUDA_VERSION="12.4.1" CUDNN_VERSION="9.2.0.82" IS_INSTALL_eRDMA="FALSE" IS_INSTALL_RDMA="FALSE" INSTALL_DIR="/root/auto_install" # Download and run the installation script auto_install_script="auto_install_v4.0.sh" script_download_url=$(curl http://100.100.100.200/latest/meta-data/source-address | head -1)"/opsx/ecs/linux/binary/script/${auto_install_script}" echo $script_download_url rm -rf $INSTALL_DIR mkdir -p $INSTALL_DIR cd $INSTALL_DIR && wget -t 10 --timeout=10 $script_download_url && bash ${INSTALL_DIR}/${auto_install_script} $DRIVER_VERSION $CUDA_VERSION $CUDNN_VERSION $IS_INSTALL_RDMA $IS_INSTALL_eRDMA
Follow the prompts to complete the purchase.
To create a GPU-accelerated instance using the RunInstances API operation, pass the installation script in the UserData parameter. For details, see RunInstances.If you did not install the driver during instance creation, run the script manually afterward: connect to the instance via SSH, create a file, paste the script content, and run it as a shell script. For connection methods, see Connection methods.
Modify the corresponding Tesla driver, CUDA, and cuDNN library versions based on the instance type and image that you created. For detailed information about supported versions, see the image versions and instance types supported by the Tesla driver when you select Public Image in Automatically install drivers by using a public image.
The following example shows how to set the Tesla driver version to 550.127.08, the CUDA version to 12.4.1, and the cuDNN version to 9.2.0.82:
DRIVER_VERSION="550.127.08"
CUDA_VERSION="12.4.1"
CUDNN_VERSION="9.2.0.82"Next steps
If you did not install the NVIDIA Tesla driver during instance creation, install it manually: