All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term


Install CUDA

Last updated:2020-12-18 10:54:36

Compute Unified Device Architecture (CUDA) is a general-purpose parallel computing architecture developed by NVIDIA. CUDA™ enables GPUs to perform complicated calculations. CUDA™ contains the CUDA instruction set architecture (ISA) and a GPU internal parallel computing engine. Developers can write programs for CUDA™ in C, C++, and Fortran. The programs can run with excellent performance on processors that support CUDA™. Kingsoft Cloud GPU Elastic Compute (GEC) uses NVIDIA graphics cards and requires you to install the development and runtime environment of CUDA.

You can download the CUDA installation script provided by Kingsoft Cloud to install CUDA. You can also download the CUDA driver from the NVIDIA official website.

Use the installation script to install the driver

Background information

You only need to install the GPU driver on instances that are equipped with NVIDIA GPUs. Only GEC instances without vGPU support the GPU driver. The installation script installs the latest GPU driver of NVIDIA on standard images. The following images are supported:

  • CentOS 7.x 64-bit (All CentOS 7 images are supported.)
  • Ubuntu 16.04 64-bit


The following procedure describes how to install CUDA in Ubuntu 16.0.4:

  • Download the CUDA installation script to your local PC.
  • Log in to the GEC instance and enable administrator privileges.

    sudo -i
  • Upload the CUDA installation script to the GEC instance.
  • In the upload dialog box that appears, select the script and upload it. Now the script has been uploaded to the current directory.

  • After the script is uploaded, click Close.

  • Run the script.

Download the CUDA driver from the NVIDIA official website

The following procedure describes how to install CUDA in Ubuntu 16.0.4:

  1. Log in to the GEC instance. Download the CUDA driver or open the link

  2. Select the CUDA installation package for your operating system. In this example, select an installer type for Ubuntu 16.0.4 64-bit.



    • Installer Type: We recommend that you select runfile (local).
    • network: the network installer. The network installer is a small executable that will only download the necessary components dynamically during the installation. Therefore, an Internet connection is required.
    • local: the local installer. The local installer has all of the components embedded into it. This makes the local installer very large.
  3. Click Download and select a directory to store the CUDA installation package.


  4. Go to the directory where the CUDA installation package is stored and run the following command:

    sudo sh  

    Type accept and yes, and press enter as prompted.


    • If the following command output is returned, the CUDA installation package contains the driver, toolkit, and samples but only the driver is installed:

      Driver: Installed require reboot    
      Toolkit: install skip  
      Samples: install skip  

      In this case, run the following command again to reinstall CUDA:

      sudo sh
    • If the following command output is returned, CUDA is installed:

      Driver: Installed   
      Toolkit: Installed in /usr/local/cuda   
      Samples: Installed in /home/XX   
  5. Run the make command in the /usr/local/cuda/samples/1_Utilities/deviceQuery directory to compile the deviceQuery program. If the device information shown in the following figure is displayed after you run the deviceQuery program, CUDA is installed correctly.


On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen