All Products
Search
Document Center

Elastic GPU Service:Install CUDA

Last Updated:Jun 21, 2026

To run workloads like scientific computing or large-scale parallel processing on a GPU-accelerated instance, you must install the CUDA development and runtime environment. CUDA provides a complete set of tools and libraries that help you develop GPU-accelerated programs to harness the full computing power of NVIDIA GPUs, improve performance, and accelerate your workloads. This topic describes how to manually install CUDA.

Background

CUDA (Compute Unified Device Architecture) is a general-purpose parallel computing architecture developed by NVIDIA. It leverages the processing power of a graphics processing unit (GPU) to solve complex computational problems. It includes the CUDA instruction set architecture (ISA) and a parallel computing engine within the GPU. You can use CUDA with C, C++, and Fortran to develop high-performance programs that run on CUDA-enabled processors. CUDA also provides interfaces for various languages, such as Java and Python.

Prerequisites

Procedure

CUDA supports both the Windows and Linux operating systems. This topic uses CUDA Toolkit 12.1.1 as an example to demonstrate how to install CUDA on GPU-accelerated instances that run Linux and Windows.

Linux

  1. Obtain the CUDA installation package.

    1. Go to the CUDA Toolkit Archive page.

    2. Select the CUDA version that corresponds to your driver.

      This topic uses CUDA Toolkit 12.1.1 as an example.

      On the official NVIDIA Developer CUDA Toolkit Archive page, locate your target version, such as CUDA Toolkit 12.1.1 (April 2023), and click the corresponding download link.

    3. Get the download URL for the CUDA installation package.

      1. Select the required parameters, such as the operating system, architecture, and version.

        Parameter

        Example value

        Operating system

        Linux

        Architecture

        x86_64

        Distribution

        Ubuntu

        Version

        20.04

        Installer type

        runfile (local)

      2. Copy the base installer commands from the page.

        $ wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
        $ sudo sh cuda_12.1.1_530.30.02_linux.run
  2. Install the CUDA package.

    1. Connect to the GPU-accelerated instance using one of the following methods.

      Connection method

      Instructions

      Workbench

      Log on to a Linux instance by using Workbench

      VNC

      Connect to an instance by using VNC

    2. Use the wget command and paste the download address from Step 1 to download the CUDA installation package.

      wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
      Important

      The download may take 5 to 10 minutes.

    3. Run the following commands to install the CUDA package.

      Note
      • For a GPU-accelerated compute-optimized instance, you can install the Tesla driver manually or install the bundled driver.

      • For a vGPU-accelerated instance, you cannot install the bundled driver during the CUDA installation. You must manually install the NVIDIA GRID driver. For more information, see Install an NVIDIA GRID driver.

      • Interactive installation

        sudo chmod +x cuda_12.1.1_530.30.02_linux.run
        sudo ./cuda_12.1.1_530.30.02_linux.run

        After you enter accept at the prompt, choose whether to install the bundled driver based on your scenario:

        • If you have a GPU-accelerated compute-optimized instance with an existing driver, press the Enter key to deselect the Driver option as shown in the following example. Then, select Install to continue.

          Important

          If you do not deselect the Driver option, the bundled driver overwrites the existing driver on the instance.

          CUDA Installer
          - [ ] Driver
              [ ] 530.30.02
          + [X] CUDA Toolkit 12.1
            [X] CUDA Demo Suite 12.1
            [X] CUDA Documentation 12.1
          - [ ] Kernel Objects
              [ ] nvidia-fs
            Options
            Install
          Up/Down: Move | Left/Right: Expand | 'Enter': Select | 'A': Advanced options
        • If you have a GPU-accelerated compute-optimized instance and want to use the bundled driver, first verify its compatibility with your instance's GPU model. For more information, see Download a Tesla driver (Linux). If the driver is compatible, keep the default selection (the Driver option is selected) and then select Install to continue.

        • For a vGPU-accelerated instance, an NVIDIA GRID driver is required. First, check if a compatible driver is already installed. For more information, see Install an NVIDIA GRID driver. If not, install the driver before proceeding. During the CUDA installation, deselect the Driver option by pressing the Enter key and then select Install to continue.

      • Silent installation

        sudo chmod +x cuda_12.1.1_530.30.02_linux.run
        sudo ./cuda_12.1.1_530.30.02_linux.run --toolkit --samples --silent
        Important

        If you use silent installation, the bundled driver is not automatically installed. You must manually install the required driver for your GPU-accelerated instance.

    4. (Optional) Restart the GPU-accelerated instance:

      reboot
    5. Configure the CUDA environment variables:

      echo 'export PATH=/usr/local/cuda/bin:$PATH' | sudo tee /etc/profile.d/cuda.sh
      source /etc/profile
  3. Verify the CUDA installation.

    1. Run the nvcc -V command to check if CUDA is installed correctly.

      root@iZxxxZ:~# nvcc -V
      nvcc: NVIDIA (R) Cuda compiler driver
      Copyright (c) 2005-2023 NVIDIA Corporation
      Built on Mon Apr__3_17:16:06_PDT_2023
      Cuda compilation tools, release 12.1, V12.1.105
      Build cuda_12.1.r12.1/compiler.32688072_0
    2. Test the CUDA Samples to verify the installation:

      cd /usr/local/cuda-12.1/extras/demo_suite
      ./deviceQuery

      If the output is Result=PASS, the CUDA installation is successful.

      deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.1, CUDA Runtime Version = 12.1, NumDevs = 1, Device0 = Tesla T4
      Result = PASS

Windows

  1. Log on to a GPU-accelerated compute-optimized instance that runs Windows.

    Connect to the GPU-accelerated instance using one of the following methods:

    Connection method

    Instructions

    Workbench

    Log on to a Windows instance by using Workbench

    VNC

    Connect to an instance by using VNC

  2. Select the CUDA version to install.

    1. Go to the CUDA Toolkit Archive page.

    2. Select the CUDA version that corresponds to your driver.

      First, verify that the driver bundled with the CUDA package is compatible with your instance's GPU model. For more information, see Download a Tesla driver (Windows). This topic uses CUDA Toolkit 12.1.1 as an example.

    3. Select the required parameters, such as the operating system, architecture, and version.

      Parameter

      Example value

      Operating system

      Windows

      Architecture

      x86_64

      Version

      Server 2022

      Installer type

      exe (local)

    4. Click Download to download the corresponding CUDA package.

      The downloaded file, cuda_12.1.1_531.14_windows.exe, is approximately 3.2 GB.

  3. Install the CUDA package.

    After the download is complete, open the folder containing the package. Double-click the executable file and follow the on-screen instructions to install it.

    If the NVIDIA Installer has finished dialog box appears, the installation is complete.

Related documents

  • After you create a GPU-accelerated instance, you may need to manually install a Tesla driver or an NVIDIA GRID driver to enable computing acceleration and graphics rendering. For more information, see Install a Tesla driver or Install an NVIDIA GRID driver.

  • If you want to automatically install the Tesla driver and CUDA tools during instance creation, see Configure the Tesla driver.