Getting Started with Linode GPU Instances

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

This guide helps you get your Linode GPU Instance up and running on a number of popular distributions. To prepare your Linode, you need to install NVIDIA’s proprietary drivers using NVIDIA’s CUDA Toolkit.

When using distributions that are not fully supported by CUDA, like Debian 9, you can install the NVIDIA driver without the CUDA toolkit. To only install the NVIDIA driver, complete the Before You Begin section and then move on to the Manual Install section of this guide.

For details on the CUDA Toolkit’s full feature set, see the official documentation.

Linode has chosen not to bundle NVIDIA’s proprietary closed-source drivers with its standard Linux distribution images. While some operating systems are packaged with the open source Nouveau driver, the NVIDIA proprietary driver provides optimal performance for your GPU-accelerated applications.
Linode has chosen not to bundle NVIDIA’s proprietary closed-source drivers with its standard …
Caution

This guide’s example instructions creates several billable resources on your Linode account. If you do not want to keep using the GPU that you create, be sure to delete it when you have finished the guide.

If you remove the resources afterward, you are only be billed for the hour(s) that the resources were present on your account. Consult the How Linode Billing Works guide for detailed information about how hourly billing works, and visit our pricing page for a table of hourly and monthly GPU costs.

Before You Begin

  1. Follow our Getting Started and Securing Your Server guides for instructions on setting up your Linodes.

  2. Make sure that your GPU is currently available on your deployed Linode:

     lspci -vnn | grep NVIDIA
    

    You should see a similar output confirming that your Linode is currently running a NVIDIA GPU. The example output was generated on Ubuntu 18.04. Your output may vary depending on your distribution.

    00:03.0 VGA compatible controller [0300]: NVIDIA Corporation TU102GL [Quadro RTX 6000/8000] [10de:1e30] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: NVIDIA Corporation Quadro RTX 6000 [10de:12ba]
    Note

    Depending on your distribution, you may need to install lspci manually first. On current CentOS and Fedora systems, you can install this utility with the following command:

    sudo yum install pciutils
    
  3. Move on to the next section to install the dependencies that NVIDIA’s drivers rely on.

Install NVIDIA Driver Dependencies

Prior to installing the driver, you should install the required dependencies. Listed below are commands for installing these packages on many popular distributions.

  1. Find your Linode’s distribution from the list below and install the NVIDIA driver’s dependencies:

    Ubuntu 18.04:

     sudo apt-get install build-essential
    

    Debian 9:

     sudo apt-get install build-essential
     sudo apt-get install linux-headers-`uname -r`
    

    CentOS 7:

     sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
     sudo yum install wget
     sudo yum -y install gcc
    

    OpenSUSE:

     zypper install gcc
     zypper install kernel-source
    
  2. After installing the dependencies, reboot your Linode from the Cloud Manager. Rebooting will ensure that any newly installed kernel headers are available for use.

NVIDIA Driver Installation

After installing the required dependencies for your Linux distribution, you are ready to install the NVIDIA driver. If you are using Ubuntu 18.04, CentOS 7, and OpenSUSE, proceed to the Install with CUDA section. If you are using Debian 9, proceed to the Install Manually section.

Install with CUDA

Note
If you are using Ubuntu 20.04, Ubuntu 18.04, CentOS 7, or OpenSUSE, follow the steps below. If you are using Debian 9, proceed to the Install Manually instructions instead.

In this section, you install the GPU driver using NVIDIA’s CUDA Toolkit.

For a full list of native Linux distribution, and kernel support in CUDA, see the CUDA toolkit documentation.

For instructions to update the kernel, see Updating Linode’s Existing Kernel, to change the kernel, see Change Your Linode’s Kernel.

  1. Visit the CUDA Downloads Page and navigate to the Select Target Platform section.

  2. Provide information about your target platform by following the prompts and selecting the appropriate options. After it is complete, you gain access to the correct download link for the CUDA Toolkit installer. Use the table below for guidance on how to respond to each prompt:

    PromptSelection
    Operating SystemLinux
    Architecturex86_64
    DistributionYour Linode’s distribution
    VersionYour distribution’s version
    Installer typerunfile (local)

    A completed set of selections resemble the following example:

  3. A Download Installer section appears below the Select Target Platform section. The green Download button in this section links to the installer file. Copy this link to your computer’s clipboard:

  4. On your Linode, update and install GNU Compiler Collection (GCC):

       apt update && apt install gcc make
    
  5. On your Linode, enter the wget command and paste in the download link you copied. This example shows the syntax for the command, but you should make sure to use the download link appropriate for your Linode:

    wget https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.168_418.67_linux.run
    
  6. After wget completes, run your version of the installer script to begin the installation process:

     sudo sh cuda_*_linux.run
    
    Note
    The installer takes a few moments to run before generating any output.
  7. Read and accept the License Agreement.

  8. Choose to install the CUDA Toolkit in its entirety or partially. To use your GPU, you only need to install the driver. Optionally, you can choose to install the full toolkit to gain access to a set of tools that empowers you to create GPU-accelerated applications.

    To only install the driver, uncheck all options directly below the Driver option. A screen similar to the following appears:

  9. After you have checked your desired options, select Install to begin the installation. A full install takes several minutes to complete.

    Note
    Installation on CentOS and Fedora fails following this step, because the installer requires a reboot to fully remove the default Nouveau driver. If you are running either of these operating systems, reboot the Linode, run the installer again, to install successfully.
  10. When the installation has completed, run the nvidia-smi command to make sure that you’re currently using your NVIDIA GPU device with its associated driver:

     nvidia-smi
    

    You should see a similar output:

     +-----------------------------------------------------------------------------+
     | NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1     |
     |-------------------------------+----------------------+----------------------+
     | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
     | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
     |===============================+======================+======================|
     |   0  Quadro RTX 6000     Off  | 00000000:00:03.0 Off |                  Off |
     | 34%   57C    P0    72W / 260W |      0MiB / 24190MiB |      0%      Default |
     +-------------------------------+----------------------+----------------------+
    
     +-----------------------------------------------------------------------------+
     | Processes:                                                       GPU Memory |
     |  GPU       PID   Type   Process name                             Usage      |
     |=============================================================================|
     |  No running processes found                                                 |
     +-----------------------------------------------------------------------------+
    

    In the output, you can see that the driver is installed and functioning correctly, the version of CUDA attributed to it, and other useful statistics.

Install Manually

Note
If you are using Debian 9, follow the steps below. If you are using Ubuntu 18.04, CentOS 7, or OpenSUSE, proceed to the Install with CUDA instructions instead.

This section will walk you through the process of downloading and installing the latest NVIDIA driver on Debian 9. This process can also be completed on another distribution of your choice, if needed:

  1. Visit NVIDIA’s Driver Downloads Page.

  2. Make sure that the options from the drop-down menus reflect the following values:

    PromptSelection
    Product TypeQuadro
    Product SeriesQuadro RTX Series
    ProductQuadro RTX 8000
    Operating SystemLinux 64-bit
    Download TypeLinux Long Lived Driver
    LanguageEnglish (US)

    The form will look as follows when completed:

  3. Click the Search button, and a page will appear that shows information about the driver. Click the green Download button on this page. The file will not download to your computer; instead, you will be taken to another download confirmation page.

  4. Copy the link for the driver installer script from the green Download button on this page:

  5. On your Linode, enter the wget command and paste in the download link you copied. This example shows the syntax for the command, but you should make sure to use the download link you copied from NVIDIA’s site:

    wget http://us.download.nvidia.com/XFree86/Linux-x86_64/430.26/NVIDIA-Linux-x86_64-430.26.run
    
  6. After wget completes, run your version of the installer script on your Linode. Follow the prompts as necessary:

     sudo bash NVIDIA-Linux-x86_64-*.run
    
  7. Select OK and Yes for all prompts as they appear.

  8. Once the installer has completed, use nvidia-smi to make sure that you’re currently using your NVIDIA GPU with its associated driver:

     nvidia-smi
    

    You should see a similar output:

     +-----------------------------------------------------------------------------+
     | NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
     |-------------------------------+----------------------+----------------------+
     | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
     | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
     |===============================+======================+======================|
     |   0  Quadro RTX 6000     Off  | 00000000:00:03.0 Off |                  Off |
     | 34%   59C    P0     1W / 260W |      0MiB / 24220MiB |      6%      Default |
     +-------------------------------+----------------------+----------------------+
    
     +-----------------------------------------------------------------------------+
     | Processes:                                                       GPU Memory |
     |  GPU       PID   Type   Process name                             Usage      |
     |=============================================================================|
     |  No running processes found                                                 |
     +-----------------------------------------------------------------------------+
    

This page was originally published on


Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.