Amazon Elastic Compute Cloud
User Guide for Linux Instances

Linux GPU Instances

If you require high parallel processing capability, you'll benefit from using GPU instances, which provide access to NVIDIA GPUs with up to 1,536 CUDA cores and 4 GB of video memory. You can use GPU instances to accelerate many scientific, engineering, and rendering applications by leveraging the Compute Unified Device Architecture (CUDA) or OpenCL parallel computing frameworks. You can also use them for graphics applications, including game streaming, 3-D application streaming, and other graphics workloads.

GPU instances run as HVM-based instances. Hardware virtual machine (HVM) virtualization uses hardware-assist technology provided by the AWS platform. With HVM virtualization, the guest VM runs as if it were on a native hardware platform, except that it still uses paravirtual (PV) network and storage drivers for improved performance. This enables Amazon EC2 to provide dedicated access to one or more discrete GPUs in each GPU instance.

You can cluster GPU instances into a placement group. Placement groups provide low latency and high-bandwidth connectivity between the instances within a single Availability Zone. For more information, see Placement Groups.

For information about Windows GPU Instances, see Windows GPU Instances in the Amazon EC2 User Guide for Windows Instances.

Hardware Specifications

For more information about the hardware specifications for each Amazon EC2 instance type, see Amazon EC2 Instances.

GPU Instance Limitations

GPU instances have the following limitations:

AMIs for GPU Instances

To help you get started, NVIDIA provides AMIs for GPU instances. These reference AMIs include the NVIDIA driver, which enables full functionality and performance of the NVIDIA GPUs. For a list of AMIs with the NVIDIA driver, see AWS Marketplace (NVIDIA GRID).

You can launch CG1 and G2 instances using any HVM AMI.

Installing the NVIDIA Driver on Linux

A GPU instance must have the appropriate NVIDIA driver. The NVIDIA driver you install must be compiled against the kernel that you intend to run on your instance.

Amazon provides AMIs with updated and compatible builds of the NVIDIA kernel drivers for each official kernel upgrade in the AWS Marketplace. If you decide to use a different NVIDIA driver version than the one that Amazon provides, or decide to use a kernel that's not an official Amazon build, you must uninstall the Amazon-provided NVIDIA packages from your system to avoid conflicts with the versions of the drivers that you are trying to install.

Use this command to uninstall Amazon-provided NVIDIA packages:

[ec2-user ~]$ sudo yum erase nvidia cuda

The Amazon-provided CUDA toolkit package has dependencies on the NVIDIA drivers. Uninstalling the NVIDIA packages erases the CUDA toolkit. You must reinstall the CUDA toolkit after installing the NVIDIA driver.

You can download NVIDIA drivers from Select the appropriate driver for your instance:

G2 Instances

Product TypeGRID
Product SeriesGRID Series
ProductGRID K520
Operating SystemLinux 64-bit

CG1 Instances

Product TypeTesla
Product SeriesM-Class
Operating SystemLinux 64-bit

For more information about installing and configuring the driver, open the ADDITIONAL INFORMATION tab on the download page for the driver on the NVIDIA website and click the README link.

Install the NVIDIA Driver Manually

To install the driver for an Amazon Linux AMI

  1. Run the yum update command to get the latest versions of packages for your instance.

    [ec2-user ~]$ sudo yum update -y
  2. Reboot your instance to load the latest kernel version.

    [ec2-user ~]$ sudo reboot
  3. Reconnect to your instance after it has rebooted.

  4. Install the "Development tools" package group.

    [ec2-user ~]$ sudo yum groupinstall -y "Development tools"
  5. Make sure the kernel-devel package is installed and matches the version of the kernel you are currently running.

    [ec2-user ~]$ sudo yum install kernel-devel-`uname -r`
  6. Download the driver package that you identified earlier. For example, the following command downloads the 361.45.11 version of the G2 instance driver.

    [ec2-user ~]$ wget
  7. Run the self-install script to install the NVIDIA driver. For example:

    [ec2-user ~]$ sudo /bin/bash ./
  8. Reboot the instance. For more information, see Reboot Your Instance.

  9. Confirm that the driver is functional. The response for the following command lists the installed NVIDIA driver version and details about the GPUs.

    [ec2-user ~]$ nvidia-smi -q | head
    ==============NVSMI LOG==============
    Timestamp                           : Thu Oct  2 17:28:29 2014
    Driver Version                      : 361.45.11
    Attached GPUs                       : 1
    GPU 0000:00:03.0
        Product Name                    : GRID K520
        Product Brand                   : Grid