This topic describes how to install an NVIDIA GRID driver and build a desktop environment
on a GPU-accelerated Linux instance.
Prerequisites
- A GPU-accelerated instance that can access the Internet is created.
Note This topic describes how to install NVIDIA GRID drivers on GPU-accelerated Linux instances.
For GPU-accelerated Windows instances, you can select paid images that have NVIDIA
GRID drivers pre-installed when you create the instances. For more information, see
Create an NVIDIA GPU-accelerated instance.
When you create an instance, we recommend that you select an image from the Public Image drop-down list. If you select an image pre-installed with the NVIDIA GRID driver
in the Image Marketplace dialog box, you must disable the nouveau driver after you create the instance.
nouveau is an open source driver. It must be disabled before you install another driver.
You can create a nouveau.conf file in the /etc/modprobe.d directory and add blacklist nouveau
to the file to disable nouveau.
- A VNC application is installed. VNC Viewer is used in this example.
- A GRID license is obtained from NVIDIA. You must build a license server. You can purchase an ECS instance and build a license
server by following the tutorial on the NVIDIA official website.
Background information
You must install an NVIDIA GRID driver if your GPU-accelerated instances need to support
Open Graphics Library (OpenGL). By default, the NVIDIA GRID license that is granted
to NVIDIA GPUs such as P100, P4, and V100 is not activated. You can activate the license
by using a trial license to use OpenGL.
Note Only NVIDIA partners can download the driver from the official NVIDIA website. This
topic describes how to obtain the installation package of the NVIDIA GRID driver from
Alibaba Cloud.
This topic describes how to install NVIDIA GRID drivers on GPU-accelerated instances
that are not equipped with vGPUs. For information about how to install NVIDIA GRID
drivers on vgn6i or vgn5i GPU-accelerated instances that are equipped with vGPUs,
see Install NVIDIA GRID drivers on vgn6i or vgn5i Linux instances.
Procedure
Perform the following operations to install an NVIDIA GRID driver:
Install an NVIDIA GRID driver on a Linux instance that runs Ubuntu 16.04 64-bit
- Connect to a Linux instance. For more information, see Connect to a Linux instance by using a username and password.
- Run the following commands in sequence to upgrade the system and install KDE:
apt-get update
apt-get upgrade
apt-get install kubuntu-desktop
- Run the
reboot
command to restart the system.
- Connect to the Linux instance again. Run the following commands to download and decompress
the NVIDIA GRID driver package.
The NVIDIA GRID driver package contains the drivers for various operating systems.
For Linux, select
NVIDIA-Linux-x86_64-410.39-grid.run.
wget http://grid-9-4.oss-cn-hangzhou.aliyuncs.com/NVIDIA-Linux-x86_64-430.99-grid.run
- Run the following commands in sequence and follow the on-screen tips to install the
NVIDIA GRID driver:
chmod 777 NVIDIA-Linux-x86_64-430.99-grid.run
. /NVIDIA-Linux-x86_64-430.99-grid.run
- Run the
nvidia-smi
command to test whether the NVIDIA GRID driver is installed.
If a command output similar to the following one is displayed, the NVIDIA GRID driver
is installed.

- Add a license server and activate the license.
- Run the
cd /etc/nvidia
command to go to the /etc/nvidia directory.
- Run the
cp gridd.conf.template gridd.conf
command to create a file named gridd.conf.
- Add the license server information to the gridd.conf file.
ServerAddress=<IP address of the license server>
ServerPort=<Port of the license server (default port: 7070)>
FeatureType=2
EnableUI=TRUE
- Run the following command to install x11vnc:
- Run the
lspci | grep NVIDIA
command to query the GPU BusID.
In this example, the GPU BusID is 00:07.0
.
- Configure the X Server environment and restart the system.
- Run the
nvidia-xconfig --enable-all-gpus --separate-x-screens
command.
- Add the GPU BusID that you obtained to
Section "Device"
in the /etc/X11/xorg.conf file. In this example, BusID "PCI:0:7:0"
is added.
- Run the
reboot
command to restart the system.
Test the NVIDIA GRID driver installed on an instance that runs Ubuntu 16.04 64-bit
- Run the following command to install the GLX application:
apt-get install mesa-utils
- Run the
startx
command to start X Server.
- If the
startx
command is unavailable, run the apt-get install xinit
command to install the GLX application.
- If you run the
startx
command, the hostname: Name or service not known
error may be reported. This error does not affect the startup of X Server. You can
run the hostname
command to query the hostname of the instance. Then, you can modify the /etc/hosts file by replacing the hostname
that follows 127.0.0.1
with the actual hostname of your instance.
- Start a new terminal session of the SSH client and run the following command to start
x11vnc:
If a command output similar to the following one is displayed, x11vnc is started.
In this case, you can connect to the instance by using a VNC application. In this
example, VNC Viewer is used.

- Log on to the ECS console and add security group rules to a security group to which
the instance is added. The security group rules allow inbound traffic on TCP port
5900. For more information, see Add security group rules.
- On the local machine, start VNC Viewer and enter
<Public IP address of the instance>:5900
to connect to the instance and go to KDE.
- Run the
glxinfo
command to view the configurations supported by the current NVIDIA GRID driver.
- Start a new terminal session of the SSH client.
- Run the
export DISPLAY=:1
command.
- Run the
glxinfo -t
command to list the configurations supported by the current NVIDIA GRID driver.
- Run the
glxgears
command to test the NVIDIA GRID driver.
- On KDE, right-click the desktop and select Run Command.
- Run the
glxgears
command to start the testing application.If a window similar to the following one is displayed, the NVIDIA GRID driver runs
normally.

Install an NVIDIA GRID driver on a Linux instance that runs CentOS 7.3 64-bit
- Connect to a Linux instance. For more information, see Connect to a Linux instance by using a username and password.
- Run the following commands in sequence to upgrade the system and install KDE:
yum update
yum install kernel-devel
yum groupinstall "KDE Plasma Workspaces"
- Run the
reboot
command to restart the system.
- Connect to the Linux instance again. Run the following command to download and decompress
the NVIDIA GRID driver package.
The NVIDIA GRID driver package contains the drivers for various operating systems.
For Linux, select NVIDIA-Linux-x86_64-430.99-grid.run.
wget http://grid-9-4.oss-cn-hangzhou.aliyuncs.com/NVIDIA-Linux-x86_64-430.99-grid.run
- Disable the nouveau driver:
- Run the
vim /etc/modprobe.d/blacklist.conf
command and add blacklist nouveau
to the file.
- Run the
vim /lib/modprobe.d/dist-blacklist.conf
command and add the following content:blacklist nouveau
options nouveau modeset=0
- Run the
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
command.
- Run the
dracut /boot/initramfs-$(uname -r).img $(uname -r)
command.
- Run the
reboot
command to restart the system.
- Run the following commands in sequence and follow the on-screen tips to install the
NVIDIA GRID driver:
chmod 777 NVIDIA-Linux-x86_64-430.99-grid.run
. /NVIDIA-Linux-x86_64-430.99-grid.run
- Run the
nvidia-smi
command to test whether the NVIDIA GRID driver is installed.If a command output similar to the following one is displayed, the NVIDIA GRID driver
is installed.

- Add a license server and activate the license.
- Run the
cd /etc/nvidia
command to go to the /etc/nvidia directory.
- Run the
cp gridd.conf.template gridd.conf
command to create a file named gridd.conf.
- Add the license server information to the gridd.conf file.
ServerAddress=<IP address of the license server>
ServerPort=<Port of the license server (default port: 7070)>
FeatureType=2
EnableUI=TRUE
- Run the following command to install x11vnc:
- Run the
lspci | grep NVIDIA
command to query the GPU BusID.In this example, the GPU BusID is 00:07.0
.
- Configure the X Server environment.
- Run the
nvidia-xconfig --enable-all-gpus --separate-x-screens
command.
- Add your GPU BusID to
Section "Device"
in the /etc/X11/xorg.conf file. In this example, BusID "PCI:0:7:0"
is added.
- Run the
reboot
command to restart the system.
Test the NVIDIA GRID driver installed on an instance that runs CentOS 7.3 64-bit
- Run the
startx
command to start X Server.
- Start a new terminal session of the SSH client and run the following command to start
x11vnc:
If a command output similar to the following one is displayed, x11vnc is started.
In this case, you can connect to the instance by using a VNC application. In this
example, VNC Viewer is used.

- Log on to the ECS console and add security group rules to a security group of the
instance. The security group rules allow inbound traffic on TCP port 5900. For more
information, see Add security group rules.
- On the local machine, start VNC Viewer and enter
<Public IP address of the instance>:5900
to connect to the instance and go to KDE.
- Run the
glxinfo
command to view the configurations supported by the current NVIDIA GRID driver.
- Start a new terminal session of the SSH client.
- Run the
export DISPLAY=:0
command.
- Run the
glxinfo -t
command to list the configurations supported by the current NVIDIA GRID driver.
- Run the
glxgears
command to test the NVIDIA GRID driver.
- On KDE, right-click the desktop and select Run Command.
- Run the
glxgears
command to start the testing application.If a window similar to the following one is displayed, the NVIDIA GRID driver runs
normally.
