Amazon Elastic Compute Cloud
User Guide for Linux (API Version 2014-09-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

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.

Hardware Specifications

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

GPU Instance Limitations

GPU instances currently 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 a CG1 instance using any HVM AMI.

You can launch a G2 instance using Linux HVM AMIs with the following operating systems: Amazon Linux, SUSE Enterprise Linux, and Ubuntu. If you encounter the following error when launching a G2 instance, contact Customer Service or reach out through the Amazon EC2 forum.

Client.UnsupportedOperation: Instances of type 'g2.2xlarge' may not be launched from AMI <ami-id>.

After you launch a G2 instance, you can create your own AMI from the instance. However, if you create a snapshot of the root volume of the instance, register it as an AMI, and then launch a G2 instance, you'll get the Client.UnsupportedOperation error. To launch a G2 instance from your own AMI, you must create the AMI from a G2 instance using the console (select the instance, click Actions, and then click Create Image), create-image (AWS CLI), or ec2-create-image (Amazon EC2 CLI).

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 cudatoolkit

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 K250
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 340.46 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                      : 340.46
    Attached GPUs                       : 1
    GPU 0000:00:03.0
        Product Name                    : GRID K520
        Product Brand                   : Grid