NVIDIA drivers for your Amazon EC2 instance
An instance with an attached NVIDIA GPU, such as a P3 or G4dn instance, must have the appropriate NVIDIA driver installed. Depending on the instance type, you can either download a public NVIDIA driver, download a driver from Amazon S3 that is available only to AWS customers, or use an AMI with the driver pre-installed.
To install AMD drivers on an instance with an attached AMD GPU, such as a G4ad instance, see AMD drivers. To install NVIDIA drivers, see NVIDIA drivers.
Contents
Types of NVIDIA drivers
The following are the main types of NVIDIA drivers that can be used with GPU-based instances.
- Tesla drivers
-
These drivers are intended primarily for compute workloads, which use GPUs for computational tasks such as parallelized floating-point calculations for machine learning and fast Fourier transforms for high performance computing applications.
- GRID drivers
-
These drivers are certified to provide optimal performance for professional visualization applications that render content such as 3D models or high-resolution videos. You can configure GRID drivers to support two modes. Quadro Virtual Workstations provide access to four 4K displays per GPU. GRID vApps provide RDSH App hosting capabilities.
- Gaming drivers
-
These drivers contain optimizations for gaming and are updated frequently to provide performance enhancements. They support a single 4K display per GPU.
Configured mode
On Windows, the Tesla drivers are configured to run in Tesla Compute Cluster (TCC) mode. The GRID and gaming drivers are configured to run in Windows Display Driver Model (WDDM) mode. In TCC mode, the card is dedicated to compute workloads. In WDDM mode, the card supports both compute and graphics workloads.
NVIDIA control panel
The NVIDIA control panel is supported with GRID and Gaming drivers. It is not supported with Tesla drivers.
Supported APIs for Tesla, GRID, and gaming drivers
-
OpenCL, OpenGL, and Vulkan
-
NVIDIA CUDA and related libraries (for example, cuDNN, TensorRT, nvJPEG, and cuBLAS)
-
NVENC for video encoding and NVDEC for video decoding
-
Windows-only APIs: DirectX, Direct2D, DirectX Video Acceleration, DirectX Raytracing
Available drivers by instance type
The following table summarizes the supported NVIDIA drivers for each GPU instance type.
Instance type | Tesla driver | GRID driver | Gaming driver |
---|---|---|---|
G3 | Yes | Yes | No |
G4dn | Yes | Yes | Yes |
G5 | Yes | Yes | Yes |
G5g | Yes ¹ | No | No |
G6 | Yes | Yes | No |
G6e | Yes | Yes | No |
Gr6 | Yes | Yes | No |
P2 | Yes | No | No |
P3 | Yes | No | No |
P4d | Yes | No | No |
P4de | Yes | No | No |
P5 | Yes | No | No |
P5e | Yes | No | No |
¹ This Tesla driver also supports optimized graphics applications specific to the ARM64 platform
² Using Marketplace AMIs only
Installation options
Use one of the following options to get the NVIDIA drivers required for your GPU instance.
Options
Option 1: AMIs with NVIDIA drivers installed
AWS and NVIDIA offer different Amazon Machine Images (AMIs) that come with the NVIDIA drivers installed.
To review considerations that are dependent on your operating system (OS) platform, choose the tab that applies to your AMI.
Option 2: Public NVIDIA drivers
The options offered by AWS come with the necessary license for the driver. Alternatively, you can install the public drivers and bring your own license. To install a public driver, download it from the NVIDIA site as described here.
Alternatively, you can use the options offered by AWS instead of the public drivers. To use a GRID driver on a P3 instance, use the AWS Marketplace AMIs as described in Option 1. To use a GRID driver on a G6, G6e, Gr6, G5, G4dn, or G3 instance, use the AWS Marketplace AMIs as described in Option 1 or install the NVIDIA drivers provided by AWS as described in Option 3: GRID drivers (G6, Gr6, G6e, G5, G4dn, and G3 instances).
To download a public NVIDIA driver
Log on to your instance and download the 64-bit NVIDIA driver
appropriate for the instance type from http://www.nvidia.com/Download/Find.aspx
Instance | Product type | Product series | Product | Minimum driver version |
---|---|---|---|---|
G3 | Tesla | M-Class | M60 | -- |
G4dn | Tesla | T-Series | T4 | -- |
G5 | Tesla | A-Series | A10 | 470.00 or later |
G5g 1 | Tesla | T-Series | NVIDIA T4G | 470.82.01 or later |
G6 | Tesla | L-Series | L4 | 525.0 or later |
G6e | Tesla | L-Series | L40S | 535.0 or later |
Gr6 | Tesla | L-Series | L4 | 525.0 or later |
P2 | Tesla | K-Series | K80 | -- |
P3 | Tesla | V-Series | V100 | -- |
P4d | Tesla | A-Series | A100 | -- |
P4de | Tesla | A-Series | A100 | -- |
P5 | Tesla | H-Series | H100 | 530 or later |
P5e | Tesla | H-Series | H200 | 550 or later |
1 The operating system for G5g instances is Linux aarch64.
To install the NVIDIA driver on Linux operating systems, see the
NVIDIA Driver Installation Quickstart Guide
To install the NVIDIA driver on Windows, follow these steps:
-
Open the folder where you downloaded the driver and launch the installation file. Follow the instructions to install the driver and reboot your instance as required.
-
Disable the display adapter named Microsoft Basic Display Adapter that is marked with a warning icon using Device Manager. Install these Windows features: Media Foundation and Quality Windows Audio Video Experience.
Important
Don't disable the display adapter named Microsoft Remote Display Adapter. If Microsoft Remote Display Adapter is disabled your connection might be interrupted and attempts to connect to the instance after it has rebooted might fail.
-
Check Device Manager to verify that the GPU is working correctly.
-
To achieve the best performance from your GPU, complete the optimization steps in Optimize GPU settings on Amazon EC2 instances.
Option 3: GRID drivers (G6, Gr6, G6e, G5, G4dn, and G3 instances)
These downloads are available to AWS customers only. By downloading, in
order to adhere to requirements of the AWS solution referred to in the NVIDIA
GRID Cloud End User License Agreement (EULA), you agree to use the downloaded
software only to develop AMIs for use with the NVIDIA L4, NVIDIA A10G, NVIDIA Tesla T4,
or NVIDIA Tesla M60 hardware. Upon installation of the software, you are bound
by the terms of the NVIDIA GRID Cloud End User License Agreement
Considerations
-
G6 and Gr6 instances require GRID 17.1 or later.
-
G6e instances require GRID 17.4 or later.
-
G5 instances require GRID 13.1 or later (or GRID 12.4 or later).
-
G3 instances require AWS provided DNS resolution for GRID licensing to work.
-
IMDSv2 is only supported with NVIDIA driver version 14.0 or greater.
-
For Windows instances, if you launch your instance from a custom Windows AMI, the AMI must be a standardized image created with Windows Sysprep to ensure that the GRID driver works. For more information, see Create an Amazon EC2 AMI using Windows Sysprep.
-
GRID 17.0 and later do not support Windows Server 2019.
-
GRID 14.2 and later do not support Windows Server 2016.
-
GRID 17.0 and later is not supported with G3 instances.
To install the NVIDIA GRID driver on your instance
-
Connect to your Linux instance.
-
Install the AWS CLI on your Linux instance and configure default credentials. For more information, see Installing the AWS CLI in the AWS Command Line Interface User Guide.
Important
Your user or role must have the permissions granted that contains the AmazonS3ReadOnlyAccess policy. For more information, see AWS managed policy: AmazonS3ReadOnlyAccess in the Amazon Simple Storage Service User Guide.
-
Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the gcc compiler and the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo yum install -y kernel-devel-$(uname -r)
-
Download the GRID driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://ec2-linux-nvidia-drivers/latest/ .
Multiple versions of the GRID driver are stored in this bucket. You can see all of the available versions using the following command.
[ec2-user ~]$
aws s3 ls --recursive s3://ec2-linux-nvidia-drivers/
-
Add permissions to run the driver installation utility using the following command.
[ec2-user ~]$
chmod +x NVIDIA-Linux-x86_64*.run
-
Run the self-install script as follows to install the GRID driver that you downloaded. For example:
[ec2-user ~]$
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run
Note
If you are using Amazon Linux 2 with kernel version 5.10, use the following command to install the GRID driver.
[ec2-user ~]$
sudo CC=/usr/bin/gcc10-cc ./NVIDIA-Linux-x86_64*.runWhen prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Confirm that the driver is functional. The response for the following command lists the installed version of the NVIDIA driver and details about the GPUs.
[ec2-user ~]$
nvidia-smi -q | head
-
If you are using NVIDIA vGPU software version 14.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) Depending on your use case, you might complete the following optional steps. If you do not require this functionality, do not complete these steps.
-
To help take advantage of the four displays of up to 4K resolution, set up the high-performance display protocol NICE DCV.
-
NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application activation steps in Activate NVIDIA GRID Virtual Applications on your Amazon EC2 GPU-based instances.
-
To install the NVIDIA GRID driver on your instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo yum install -y kernel-devel-$(uname -r)
-
Disable the
nouveau
open source driver for NVIDIA graphics cards.-
Add
nouveau
to the/etc/modprobe.d/blacklist.conf
blacklist file. Copy the following code block and paste it into a terminal.[ec2-user ~]$
cat << EOF | sudo tee --append /etc/modprobe.d/blacklist.conf blacklist vga16fb blacklist nouveau blacklist rivafb blacklist nvidiafb blacklist rivatv EOF
-
Edit the
/etc/default/grub
file and add the following line:GRUB_CMDLINE_LINUX="rdblacklist=nouveau"
-
Rebuild the Grub configuration.
[ec2-user ~]$
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
-
-
Download the GRID driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://ec2-linux-nvidia-drivers/latest/ .
Multiple versions of the GRID driver are stored in this bucket. You can see all of the available versions using the following command.
[ec2-user ~]$
aws s3 ls --recursive s3://ec2-linux-nvidia-drivers/
-
Add permissions to run the driver installation utility using the following command.
[ec2-user ~]$
chmod +x NVIDIA-Linux-x86_64*.run
-
Run the self-install script as follows to install the GRID driver that you downloaded. For example:
[ec2-user ~]$
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Confirm that the driver is functional. The response for the following command lists the installed version of the NVIDIA driver and details about the GPUs.
[ec2-user ~]$
nvidia-smi -q | head
-
If you are using NVIDIA vGPU software version 14.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) Depending on your use case, you might complete the following optional steps. If you do not require this functionality, do not complete these steps.
-
To help take advantage of the four displays of up to 4K resolution, set up the high-performance display protocol NICE DCV.
-
NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application activation steps in Activate NVIDIA GRID Virtual Applications on your Amazon EC2 GPU-based instances.
-
Install the GUI desktop/workstation package.
[ec2-user ~]$
sudo yum groupinstall -y "Server with GUI"
-
To install the NVIDIA GRID driver on your instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo dnf install -y elfutils-libelf-devel libglvnd-devel kernel-devel-$(uname -r)
-
Download the GRID driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://ec2-linux-nvidia-drivers/latest/ .
Multiple versions of the GRID driver are stored in this bucket. You can see all of the available versions using the following command.
[ec2-user ~]$
aws s3 ls --recursive s3://ec2-linux-nvidia-drivers/
-
Add permissions to run the driver installation utility using the following command.
[ec2-user ~]$
chmod +x NVIDIA-Linux-x86_64*.run
-
Run the self-install script as follows to install the GRID driver that you downloaded. For example:
[ec2-user ~]$
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Confirm that the driver is functional. The response for the following command lists the installed version of the NVIDIA driver and details about the GPUs.
[ec2-user ~]$
nvidia-smi -q | head
-
If you are using NVIDIA vGPU software version 14.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) Depending on your use case, you might complete the following optional steps. If you do not require this functionality, do not complete these steps.
-
To help take advantage of the four displays of up to 4K resolution, set up the high-performance display protocol NICE DCV.
-
NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application activation steps in Activate NVIDIA GRID Virtual Applications on your Amazon EC2 GPU-based instances.
-
Install the GUI workstation package.
[ec2-user ~]$
sudo dnf groupinstall -y workstation
-
To install the NVIDIA GRID driver on your Linux instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo dnf install -y elfutils-libelf-devel libglvnd-devel kernel-devel-$(uname -r)
-
Download the GRID driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://ec2-linux-nvidia-drivers/latest/ .
Multiple versions of the GRID driver are stored in this bucket. You can see all of the available versions using the following command.
[ec2-user ~]$
aws s3 ls --recursive s3://ec2-linux-nvidia-drivers/
-
Add permissions to run the driver installation utility using the following command.
[ec2-user ~]$
chmod +x NVIDIA-Linux-x86_64*.run
-
Run the self-install script as follows to install the GRID driver that you downloaded. For example:
[ec2-user ~]$
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Confirm that the driver is functional. The response for the following command lists the installed version of the NVIDIA driver and details about the GPUs.
[ec2-user ~]$
nvidia-smi -q | head
-
If you are using NVIDIA vGPU software version 14.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) Depending on your use case, you might complete the following optional steps. If you do not require this functionality, do not complete these steps.
-
To help take advantage of the four displays of up to 4K resolution, set up the high-performance display protocol NICE DCV.
-
NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application activation steps in Activate NVIDIA GRID Virtual Applications on your Amazon EC2 GPU-based instances.
-
To install the NVIDIA GRID driver on your instance
-
Update your package cache and get the package updates for your instance.
$
sudo apt-get update -y
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo apt-get install -y gcc make
-
(Ubuntu) Upgrade the
linux-aws
package to receive the latest version.$
sudo apt-get upgrade -y linux-aws
(Debian) Upgrade package to receive the latest version.
$
sudo apt-get upgrade -y
-
Reboot your instance to load the latest kernel version.
$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the gcc compiler and the kernel headers package for the version of the kernel you are currently running.
$
sudo apt-get install -y linux-headers-$(uname -r)
-
Disable the
nouveau
open source driver for NVIDIA graphics cards.-
Add
nouveau
to the/etc/modprobe.d/blacklist.conf
blacklist file. Copy the following code block and paste it into a terminal.$
cat << EOF | sudo tee --append /etc/modprobe.d/blacklist.conf blacklist vga16fb blacklist nouveau blacklist rivafb blacklist nvidiafb blacklist rivatv EOF
-
Edit the
/etc/default/grub
file and add the following line:GRUB_CMDLINE_LINUX="rdblacklist=nouveau"
-
Rebuild the Grub configuration.
$
sudo update-grub
-
-
Download the GRID driver installation utility using the following command:
$
aws s3 cp --recursive s3://ec2-linux-nvidia-drivers/latest/ .
Multiple versions of the GRID driver are stored in this bucket. You can see all of the available versions using the following command.
$
aws s3 ls --recursive s3://ec2-linux-nvidia-drivers/
-
Add permissions to run the driver installation utility using the following command.
$
chmod +x NVIDIA-Linux-x86_64*.run
-
Run the self-install script as follows to install the GRID driver that you downloaded. For example:
$
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Confirm that the driver is functional. The response for the following command lists the installed version of the NVIDIA driver and details about the GPUs.
$
nvidia-smi -q | head
-
If you are using NVIDIA vGPU software version 14.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. $
sudo touch /etc/modprobe.d/nvidia.conf
$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
$
sudo reboot
-
(Optional) Depending on your use case, you might complete the following optional steps. If you do not require this functionality, do not complete these steps.
-
To help take advantage of the four displays of up to 4K resolution, set up the high-performance display protocol NICE DCV.
-
NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application activation steps in Activate NVIDIA GRID Virtual Applications on your Amazon EC2 GPU-based instances.
-
Install the GUI desktop/workstation package.
$
sudo apt-get install -y lightdm ubuntu-desktop
-
To install the NVIDIA GRID driver on your Windows instance
-
Connect to your Windows instance and open a PowerShell window.
-
Configure default credentials for the AWS Tools for Windows PowerShell on your Windows instance. For more information, see Getting Started with the AWS Tools for Windows PowerShell in the AWS Tools for Windows PowerShell User Guide.
Important
Your user or role must have the permissions granted that contains the AmazonS3ReadOnlyAccess policy. For more information, see AWS managed policy: AmazonS3ReadOnlyAccess in the Amazon Simple Storage Service User Guide.
-
Download the drivers and the NVIDIA GRID Cloud End User License Agreement
from Amazon S3 to your desktop using the following PowerShell commands. $Bucket = "ec2-windows-nvidia-drivers" $KeyPrefix = "latest" $LocalPath = "$home\Desktop\NVIDIA" $Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1 foreach ($Object in $Objects) { $LocalFileName = $Object.Key if ($LocalFileName -ne '' -and $Object.Size -ne 0) { $LocalFilePath = Join-Path $LocalPath $LocalFileName Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -Region us-east-1 } }
Multiple versions of the NVIDIA GRID driver are stored in this bucket. You can download all of the available Windows versions in the bucket by removing the
-KeyPrefix $KeyPrefix
option. For information about the version of the NVIDIA GRID driver for your operating system, see the NVIDIA® Virtual GPU (vGPU) Software Documentationon the NVIDIA website. Starting with GRID version 11.0, you can use the drivers under
latest
for both G3 and G4dn instances. We will not add versions later than 11.0 tog4/latest
, but will keep version 11.0 and the earlier versions specific to G4dn underg4/latest
.G5 instances require GRID 13.1 or later (or GRID 12.4 or later).
-
Navigate to the desktop and double-click the installation file to launch it (choose the driver version that corresponds to your instance OS version). Follow the instructions to install the driver and reboot your instance as required. To verify that the GPU is working properly, check Device Manager.
-
(Optional) Use the following command to disable the licensing page in the control panel to prevent users from accidentally changing the product type (NVIDIA GRID Virtual Workstation is enabled by default). For more information, see the GRID Licensing User Guide
. PowerShell
Run the following PowerShell commands to create the registry value to disable the licensing page in the control panel. The AWS Tools for PowerShell in AWS Windows AMIs defaults to the 32-bit version and this command fails. Instead, use the 64-bit version of PowerShell included with the operating system.
New-Item -Path "HKLM:\SOFTWARE\NVIDIA Corporation\Global" -Name GridLicensing New-ItemProperty -Path "HKLM:\SOFTWARE\NVIDIA Corporation\Global\GridLicensing" -Name "NvCplDisableManageLicensePage" -PropertyType "DWord" -Value "1"
Command Prompt
Run the following registry command to create the registry value to disable the licensing page in the control panel. You can run it using the Command Prompt window or a 64-bit version of PowerShell.
reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\GridLicensing" /v NvCplDisableManageLicensePage /t REG_DWORD /d 1
-
(Optional) Depending on your use case, you might complete the following optional steps. If you do not require this functionality, do not complete these steps.
-
To help take advantage of the four displays of up to 4K resolution, set up the high-performance display protocol, Amazon DCV.
-
NVIDIA Quadro Virtual Workstation mode is enabled by default. To activate GRID Virtual Applications for RDSH Application hosting capabilities, complete the GRID Virtual Application activation steps in Activate NVIDIA GRID Virtual Applications on your Amazon EC2 GPU-based instances.
-
Option 4: NVIDIA gaming drivers (G5 and G4dn instances)
These drivers are available to AWS customers only. By downloading them, you
agree to use the downloaded software only to develop AMIs for use with the
NVIDIA A10G, and NVIDIA Tesla T4 hardware. Upon installation of the software,
you are bound by the terms of the NVIDIA GRID Cloud End User License Agreement
Considerations
-
G3 instances require AWS provided DNS resolution for GRID licensing to work.
-
IMDSv2 is only supported with NVIDIA driver version 495.x or greater.
Prerequisite
Before you install the NVIDIA gaming drivers, verify that you have the AWS CLI installed on your instance and have configured default credentials. For more information, see Installing the AWS CLI in the AWS Command Line Interface User Guide.
Important
Your user or role must have the permissions granted that contains the AmazonS3ReadOnlyAccess policy. For more information, see AWS managed policy: AmazonS3ReadOnlyAccess in the Amazon Simple Storage Service User Guide.
To install the NVIDIA gaming driver on your instance
-
Connect to your Linux instance.
-
Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo yum install -y kernel-devel-$(uname -r)
-
Download the gaming driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://nvidia-gaming/linux/latest/ .
Multiple versions of the gaming driver are stored in this bucket. You can see all of the available versions using the following command:
[ec2-user ~]$
aws s3 ls --recursive s3://nvidia-gaming/linux/
-
Extract the gaming driver installation utility from the downloaded
.zip
archive.[ec2-user ~]$
unzip
latest-driver-name
.zip -d nvidia-drivers -
Add permissions to run the driver installation utility using the following command:
[ec2-user ~]$
chmod +x nvidia-drivers/NVIDIA-Linux-x86_64*-grid.run
-
Run the installer using the following command:
[ec2-user ~]$
sudo ./nvidia-drivers/NVIDIA-Linux-x86_64*.run
Note
If you are using Amazon Linux 2 with kernel version 5.10, use the following command to install the NVIDIA gaming drivers.
[ec2-user ~]$
sudo CC=/usr/bin/gcc10-cc ./NVIDIA-Linux-x86_64*.runWhen prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Use the following command to create the required configuration file.
[ec2-user ~]$
cat << EOF | sudo tee -a /etc/nvidia/gridd.conf vGamingMarketplace=2 EOF
-
Use the following command to download and rename the certification file.
-
For version 460.39 or later:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertLinux_2024_02_22.cert"
-
For version 440.68 to 445.48:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2020_04.cert"
-
For earlier versions:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2019_09.cert"
-
-
If you are using NVIDIA driver version 510.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) To help take advantage of a single display of up to 4K resolution, set up the high-performance display protocol NICE DCV.
To install the NVIDIA gaming driver on your instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo yum install -y unzip kernel-devel-$(uname -r)
-
Disable the
nouveau
open source driver for NVIDIA graphics cards.-
Add
nouveau
to the/etc/modprobe.d/blacklist.conf
blacklist file. Copy the following code block and paste it into a terminal.[ec2-user ~]$
cat << EOF | sudo tee --append /etc/modprobe.d/blacklist.conf blacklist vga16fb blacklist nouveau blacklist rivafb blacklist nvidiafb blacklist rivatv EOF
-
Edit the
/etc/default/grub
file and add the following line:GRUB_CMDLINE_LINUX="rdblacklist=nouveau"
-
Rebuild the Grub configuration.
[ec2-user ~]$
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
-
-
Download the gaming driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://nvidia-gaming/linux/latest/ .
Multiple versions of the gaming driver are stored in this bucket. You can see all of the available versions using the following command:
[ec2-user ~]$
aws s3 ls --recursive s3://nvidia-gaming/linux/
-
Extract the gaming driver installation utility from the downloaded
.zip
archive.[ec2-user ~]$
unzip *Gaming-Linux-Guest-Drivers.zip -d nvidia-drivers
-
Add permissions to run the driver installation utility using the following command:
[ec2-user ~]$
chmod +x nvidia-drivers/NVIDIA-Linux-x86_64*-grid.run
-
Run the installer using the following command:
[ec2-user ~]$
sudo nvidia-drivers/NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Use the following command to create the required configuration file.
[ec2-user ~]$
cat << EOF | sudo tee -a /etc/nvidia/gridd.conf vGamingMarketplace=2 EOF
-
Use the following command to download and rename the certification file.
-
For version 460.39 or later:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertLinux_2024_02_22.cert"
-
For version 440.68 to 445.48:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2020_04.cert"
-
For earlier versions:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2019_09.cert"
-
-
If you are using NVIDIA driver version 510.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) To help take advantage of a single display of up to 4K resolution, set up the high-performance display protocol NICE DCV. If you do not require this functionality, do not complete this step.
To install the NVIDIA gaming driver on your instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo yum install -y unzip kernel-devel-$(uname -r)
-
Download the gaming driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://nvidia-gaming/linux/latest/ .
Multiple versions of the gaming driver are stored in this bucket. You can see all of the available versions using the following command:
[ec2-user ~]$
aws s3 ls --recursive s3://nvidia-gaming/linux/
-
Extract the gaming driver installation utility from the downloaded
.zip
archive.[ec2-user ~]$
unzip *Gaming-Linux-Guest-Drivers.zip -d nvidia-drivers
-
Add permissions to run the driver installation utility using the following command:
[ec2-user ~]$
chmod +x nvidia-drivers/NVIDIA-Linux-x86_64*-grid.run
-
Run the installer using the following command:
[ec2-user ~]$
sudo nvidia-drivers/NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Use the following command to create the required configuration file.
[ec2-user ~]$
cat << EOF | sudo tee -a /etc/nvidia/gridd.conf vGamingMarketplace=2 EOF
-
Use the following command to download and rename the certification file.
-
For version 460.39 or later:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertLinux_2024_02_22.cert"
-
For version 440.68 to 445.48:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2020_04.cert"
-
For earlier versions:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2019_09.cert"
-
-
If you are using NVIDIA driver version 510.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) To help take advantage of a single display of up to 4K resolution, set up the high-performance display protocol NICE DCV.
To install the NVIDIA gaming driver on your instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
[ec2-user ~]$
sudo yum update -y
-
Reboot your instance to load the latest kernel version.
[ec2-user ~]$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
[ec2-user ~]$
sudo dnf install -y unzip elfutils-libelf-devel libglvnd-devel kernel-devel-$(uname -r)
-
Download the gaming driver installation utility using the following command:
[ec2-user ~]$
aws s3 cp --recursive s3://nvidia-gaming/linux/latest/ .
Multiple versions of the gaming driver are stored in this bucket. You can see all of the available versions using the following command:
[ec2-user ~]$
aws s3 ls --recursive s3://nvidia-gaming/linux/
-
Extract the gaming driver installation utility from the downloaded
.zip
archive.[ec2-user ~]$
unzip *Gaming-Linux-Guest-Drivers.zip -d nvidia-drivers
-
Add permissions to run the driver installation utility using the following command:
[ec2-user ~]$
chmod +x nvidia-drivers/NVIDIA-Linux-x86_64*-grid.run
-
Run the installer using the following command:
[ec2-user ~]$
sudo nvidia-drivers/NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Use the following command to create the required configuration file.
[ec2-user ~]$
cat << EOF | sudo tee -a /etc/nvidia/gridd.conf vGamingMarketplace=2 EOF
-
Use the following command to download and rename the certification file.
-
For version 460.39 or later:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertLinux_2024_02_22.cert"
-
For version 440.68 to 445.48:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2020_04.cert"
-
For earlier versions:
[ec2-user ~]$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2019_09.cert"
-
-
If you are using NVIDIA driver version 510.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. [ec2-user ~]$
sudo touch /etc/modprobe.d/nvidia.conf
[ec2-user ~]$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
[ec2-user ~]$
sudo reboot
-
(Optional) To help take advantage of a single display of up to 4K resolution, set up the high-performance display protocol NICE DCV.
To install the NVIDIA gaming driver on your instance
-
Connect to your Linux instance. Install gcc and make, if they are not already installed.
[ec2-user ~]$
sudo yum install -y gcc make
-
Update your package cache and get the package updates for your instance.
$
sudo apt-get update -y
-
Upgrade the
linux-aws
package to receive the latest version.$
sudo apt-get upgrade -y linux-aws
-
Reboot your instance to load the latest kernel version.
$
sudo reboot
-
Reconnect to your instance after it has rebooted.
-
Install the kernel headers package for the version of the kernel you are currently running.
$
sudo apt-get install -y unzip linux-headers-$(uname -r)
-
Disable the
nouveau
open source driver for NVIDIA graphics cards.-
Add
nouveau
to the/etc/modprobe.d/blacklist.conf
blacklist file. Copy the following code block and paste it into a terminal.$
cat << EOF | sudo tee --append /etc/modprobe.d/blacklist.conf blacklist vga16fb blacklist nouveau blacklist rivafb blacklist nvidiafb blacklist rivatv EOF
-
Edit the
/etc/default/grub
file and add the following line:GRUB_CMDLINE_LINUX="rdblacklist=nouveau"
-
Rebuild the Grub configuration.
$
sudo update-grub
-
-
Download the gaming driver installation utility using the following command:
$
aws s3 cp --recursive s3://nvidia-gaming/linux/latest/ .
Multiple versions of the gaming driver are stored in this bucket. You can see all of the available versions using the following command:
$
aws s3 ls --recursive s3://nvidia-gaming/linux/
-
Extract the gaming driver installation utility from the downloaded
.zip
archive.$
unzip *Gaming-Linux-Guest-Drivers.zip -d nvidia-drivers
-
Add permissions to run the driver installation utility using the following command:
$
chmod +x nvidia-drivers/NVIDIA-Linux-x86_64*-grid.run
-
Run the installer using the following command:
$
sudo nvidia-drivers/NVIDIA-Linux-x86_64*.run
When prompted, accept the license agreement and specify the installation options as required (you can accept the default options).
-
Use the following command to create the required configuration file.
$
cat << EOF | sudo tee -a /etc/nvidia/gridd.conf vGamingMarketplace=2 EOF
-
Use the following command to download and rename the certification file.
-
For version 460.39 or later:
$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertLinux_2024_02_22.cert"
-
For version 440.68 to 445.48:
$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2020_04.cert"
-
For earlier versions:
$
sudo curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Linux_2019_09.cert"
-
-
If you are using NVIDIA driver version 510.x or greater on the G4dn, G5, or G5g instances, disable GSP with the following commands. For more information, on why this is required visit NVIDIA’s documentation
. $
sudo touch /etc/modprobe.d/nvidia.conf
$
echo "options nvidia NVreg_EnableGpuFirmware=0" | sudo tee --append /etc/modprobe.d/nvidia.conf
-
Reboot the instance.
$
sudo reboot
-
(Optional) To help take advantage of a single display of up to 4K resolution, set up the high-performance display protocol NICE DCV. If you do not require this functionality, do not complete this step.
Before you install an NVIDIA gaming driver on your instance, you must ensure that the following prerequisites are met in addition to the considerations mentioned for all gaming drivers.
-
If you launch your Windows instance using a custom Windows AMI, the AMI must be a standardized image created with Windows Sysprep to ensure that the gaming driver works. For more information, see Create an Amazon EC2 AMI using Windows Sysprep.
-
Configure default credentials for the AWS Tools for Windows PowerShell on your Windows instance. For more information, see Getting Started with the AWS Tools for Windows PowerShell in the AWS Tools for Windows PowerShell User Guide.
To install the NVIDIA gaming driver on your Windows instance
-
Connect to your Windows instance and open a PowerShell window.
-
Download and install the gaming driver using the following PowerShell commands.
$Bucket = "nvidia-gaming" $KeyPrefix = "windows/latest" $LocalPath = "$home\Desktop\NVIDIA" $Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1 foreach ($Object in $Objects) { $LocalFileName = $Object.Key if ($LocalFileName -ne '' -and $Object.Size -ne 0) { $LocalFilePath = Join-Path $LocalPath $LocalFileName Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -Region us-east-1 } }
Multiple versions of the NVIDIA GRID driver are stored in this S3 bucket. You can download all of the available versions in the bucket if you change the value of the
$KeyPrefix
variable from "windows/latest" to "windows". -
Navigate to the desktop and double-click the installation file to launch it (choose the driver version that corresponds to your instance OS version). Follow the instructions to install the driver and reboot your instance as required. To verify that the GPU is working properly, check Device Manager.
-
Use one of the following methods to register the driver.
-
Run the following command in PowerShell. This downloads the certification file, renames the file
GridSwCert.txt
, and moves the file to the Public Documents folder on your system drive. Typically, the folder path isC:\Users\Public\Documents
.-
For version 460.39 or later:
Invoke-WebRequest -Uri "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertWindows_2024_02_22.cert" -OutFile "$Env:PUBLIC\Documents\GridSwCert.txt"
-
For version 445.87:
Invoke-WebRequest -Uri "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Windows_2020_04.cert" -OutFile "$Env:PUBLIC\Documents\GridSwCert.txt"
-
For earlier versions:
Invoke-WebRequest -Uri "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Windows_2019_09.cert" -OutFile "$Env:PUBLIC\Documents\GridSwCert.txt"
Note
If you receive an error when downloading the file, and you are using Windows Server 2016 or earlier, TLS 1.2 might need to be enabled for your PowerShell terminal. You can enable TLS 1.2 for the current PowerShell session with the following command and then try again:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-
-
Reboot your instance.
-
Verify the NVIDIA Gaming license using the following command.
C:\Windows\System32\DriverStore\FileRepository\nvgridsw_aws.inf_*\nvidia-smi.exe -q
The output should be similar to the following.
vGPU Software Licensed Product Product Name : NVIDIA Cloud Gaming License Status : Licensed (Expiry: N/A)
-
(Optional) To help take advantage of the single display of up to 4K resolution, set up the high-performance display protocol NICE DCV. If you do not require this functionality, do not complete this step.
Install an additional version of CUDA
After you install an NVIDIA graphics driver on your instance, you can install a version of CUDA other than the version that is bundled with the graphics driver. The following procedure demonstrates how to configure multiple versions of CUDA on the instance.
Follow these steps to install the CUDA toolkit on Linux:
-
Connect to your Linux instance.
-
Open the NVIDIA website
and select the version of CUDA that you need. -
Select the architecture, distribution, and version for the operating system on your instance. For Installer Type, select runfile (local).
-
Follow the instructions to download the install script.
-
Add run permissions to the install script that you downloaded using the following command.
[ec2-user ~]$
chmod +xdownloaded_installer_file
-
Run the install script as follows to install the CUDA toolkit and add the CUDA version number to the toolkit path.
[ec2-user ~]$
sudo shdownloaded_installer_file
--silent --override --toolkit --samples --toolkitpath=/usr/local/cuda-version
--samplespath=/usr/local/cuda --no-opengl-libs -
(Optional) Set the default CUDA version as follows.
[ec2-user ~]$
sudo ln -s /usr/local/cuda-version
/usr/local/cuda
Follow these steps to install the CUDA toolkit on Windows:
To install the CUDA toolkit
-
Connect to your Windows instance.
-
Open the NVIDIA website
and select the version of CUDA that you need. -
For Installer Type, select exe (local) and then choose Download.
-
Using your browser, run the downloaded install file. Follow the instructions to install the CUDA toolkit. You might be required to reboot the instance.