edit-icon download-icon

Install GRID driver on a gn5 instance

Last Updated: Aug 02, 2018

If your GPU instance requires OpenGL, you must install the GRID driver on the instance. The NVIDIA GRID license granted to the NVIDIA GPU (such as P100, P4) of gn5 instances cannot meet the graphics requirements of OpenGL. However, you can use the trial version of the GRID driver to meet the requirements.

This article explains how to install the GRID driver and deploy a desktop environment on an ECS GPU Linux instance running Ubuntu 16.04 or CentOS 7.

Ubuntu 16.04

This section describes how to install the GRID driver on an ECS GPU instance running Ubuntu 16.04.

Prerequisites

  • You have created a gn5 instance. For more information, see Create an ECS instance.

    Note: We recommend that you use a public image rather than an image from the marketplace that is pre-installed with a NVIDIA driver. Otherwise, you have to disable the Nouveau driver after the instance is created. To disable the Nouveau driver, create a file named nouveau.conf in the directory of /etc/modprobe.d and add blacklist nouveau into the file.

  • You have installed a VNC application on your local machine. In this example, VNC Viewer is used.

Install GRID driver

To install the GRID driver, follow these steps:

  1. Connect to the Linux instance.

  2. Run the following commands in sequence to upgrade the system and install the KDE.

    1. apt-get update
    2. apt-get upgrade
    3. apt-get install kubuntu-desktop
  3. Run reboot to restart the system.

  4. Connect to the Linux instance again, and then run the following commands to download and decompress the NVIDIA GRID driver package.

    Note: The NVIDIA GRID driver package contains GRID related documentation and the drivers for various operating systems. The NVIDIA-Linux-x86_64-390.57-grid.run file is the driver for Linux OS.

    1. wget https://nvidia-driver.oss-cn-huhehaote.aliyuncs.com/NVIDIA-Linux-x86_64-390.57-grid.run
  5. Run the following commands in sequence then follow the prompts to install the NVIDIA GRID driver.

    1. chmod 777 NVIDIA-Linux-x86_64-390.57-grid.run
    2. ./NVIDIA-Linux-x86_64-390.57-grid.run
  6. Run nvidia-smi to verify the installation of the driver. The result shown in the following figure indicates that the driver has been installed successfully.

    Test driver installed successfully

  7. Add License Server to activate License:

    1. Run cd /etc/nvidia to switch to the /etc/nvidia directory.
    2. Run cp gridd.conf.template gridd.conf to create a file named gridd.conf.
    3. Add the following lines about License Server to the gridd.conf file.
      1. ServerAddress=116.62.19.179
      2. ServerPort=7070
      3. FeatureType=2
      4. EnableUI=TRUE
  8. Run the command to install x11vnc.

    1. apt-get install x11vnc
  9. Run lspci | grep NVIDIA to check GPU BusID. In this example, the GPU BusID is 00:07.0.

  10. Configure the X Server environment and restart the system:

    1. Run nvidia-xconfig --enable-all-gpus --separate-x-screens.
    2. Edit /etc/X11/xorg.conf: Add your GPU BusID to the Section "Device" section. In this example, BusID "PCI:0:7:0" is added.
      Add GPU BusID
    3. Run reboot to restart the system.

Verify installation

To verify installation of the GRID driver, follow these steps:

  1. Run the following command to install the GLX application.

    1. apt-get install mesa-utils
  2. Run startx to start X Server.

    Note:

    • If the startx command cannot be found, run apt-get install xinit to install it.
    • Running startx may result in the hostname: Name or service not known error. This error has no effect on starting X Server. Run hostname to obtain the host name of the instance, and then modify the /etc/hosts file by replacing the hostname, which is preceded by 127.0.0.1, with the actual host name of your instance.
      Error occurs when running startx
  3. Start a new terminal session of the SSH client and run the following command to start x11vnc.

    1. x11vnc -display :1

    The result shown in the following figure indicates that x11vnc has been restarted successfully. Now you can connect to the instance by using a VNC application. In this example, VNC Viewer is used.

    Start x11vnc

  4. Log on to the ECS console, and add a rule in the security group to allow inbound traffic from the Internet on the TCP 5900 port. For more information, see Add a security group rule.

  5. On the local machine, start VNC Viewer and type Public IP address of the instance:5900 to connect to the instance.

  6. Run glxinfo to test the GRID driver:

    1. Start a new terminal session of the SSH client.
    2. Run export DISPLAY=:1.
    3. Run glxinfo –t to list the configurations supported by the current GRID driver.
  7. Run glxgears to test the GRID driver:

    1. On the VNC Viewer, right-click the desktop and select Run Command.
    2. Run glxgears to start the testing application.
      The result shown in the following figure indicates that the GRID driver works normally.
      glxgears result

CentOS 7

In this section, the public image CentOS 7.3 64-bit is used as an example to demonstrate how to install the GRID driver on an ECS GPU instance running CentOS 7.

Prerequisites

  • You have created a gn5 instance. For more information, see Create an ECS instance. Make sure the instance can access the Internet.

  • You have installed a VNC application on your local machine. In this example, VNC Viewer is used.

Install GRID driver

To install the GRID driver, follow these steps:

  1. Connect to the Linux instance.

  2. Run the following commands in sequence to upgrade the system and install the KDE.

    1. yum update
    2. yum install kernel-devel
    3. yum groupinstall "KDE Plasma Workspaces"
  3. Run reboot to restart the system.

  4. Connect to the Linux instance again, and then run the following commands to download the NVIDIA GRID driver package.
    The NVIDIA GRID driver package contains GRID related documentation and the drivers for various operating systems, of which NVIDIA-Linux-x86_64-390.57-grid.run is the driver for Linux OS.

    1. wget https://nvidia-driver.oss-cn-huhehaote.aliyuncs.com/NVIDIA-Linux-x86_64-390.57-grid.run
  5. Disable the nouveau driver:

    1. Run vim /etc/modprobe.d/blacklist.conf, and add blacklist nouveau to the file.
    2. Run vim /lib/modprobe.d/dist-blacklist.conf and add the following lines.
      1. blacklist nouveau
      2. options nouveau modeset=0
    3. Run mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img.
    4. Run dracut /boot/initramfs-$(uname -r).img $(uname -r).
  6. Run reboot to restart the system.

  7. Run the following commands in sequence then follow the prompts to install the NVIDIA GRID driver.

    1. chmod 777 NVIDIA-Linux-x86_64-390.57-grid.run
    2. ./NVIDIA-Linux-x86_64-390.57-grid.run
  8. Run nvidia-smi to verify the installation of the driver. The result shown in the following figure indicates that the driver has been installed successfully.

    CentOS_Test driver installed successfully

  9. Add License Server to activate License:

    1. Run cd /etc/nvidia to switch to the /etc/nvidia directory.
    2. Run cp gridd.conf.template gridd.conf to create a file named gridd.conf.
    3. Add the following lines about License Server to the gridd.conf file.
      1. ServerAddress=116.62.19.179
      2. ServerPort=7070
      3. FeatureType=2
      4. EnableUI=TRUE
  10. Run the following command to install x11vnc.

    1. yum install x11vnc
  11. Run lspci | grep NVIDIA to check GPU BusID. In this example, the GPU BusID is 00:07.0.

  12. Configure the X Server environment and restart the system:

    1. Run nvidia-xconfig --enable-all-gpus --separate-x-screens.
    2. Edit /etc/X11/xorg.conf: Add your GPU BusID to the Section "Device" section. In this example, BusID "PCI:0:7:0" is added.
      Add GPU BusID
    3. Run reboot to restart the system.

Verify installation

To verify installation of the GRID driver, follow these steps:

  1. Run startx to start X Server.

  2. Start a new terminal session of the SSH client and run the command to start x11vnc.

    1. x11vnc -display :0

    The result shown in the following figure indicates that x11vnc has been started successfully. Now you can connect to the instance by using a VNC application. In this example, VNC Viewer is used.

    Start x11vnc

  3. Log on to the ECS console, and add a rule in the security group to allow the Internet inbound traffic on TCP 5900 port. For more information, see Add a security group rule.

  4. On the local machine, start VNC Viewer and type Public IP address of the instance:5900 to connect to the instance.

  5. Run glxinfo to test the GRID driver:

    1. Start a new terminal session of the SSH client.
    2. Run export DISPLAY=:0.
    3. Run glxinfo –t to list the configurations supported by the current GRID driver.
  6. Run glxgears to test the GRID driver:

    1. On the VNC Viewer, right-click the desktop and select Run Command.
    2. Run glxgears to start the testing application.
      The result shown in the following figure indicates that the GRID driver works normally.
      glxgears result
Thank you! We've received your feedback.