Install NVIDIA T4 on AWS Windows 2019 Ec2 Instance

Rate this Article
No votes yet

To install NVIDIA drivers on your AWS Windows EC2 instance using the IAM role follow these steps:

Prerequisites:

  1. Ensure Instance Type Supports GPU: Confirm that your EC2 instance type supports GPUs (e.g., G4dn, G3, or G5).
  2. IAM Role Setup: Attach the "GSS-Teradici" IAM role to your EC2 instance to grant permissions for accessing the S3 bucket containing the NVIDIA drivers.

Step-by-Step Instructions

  1. Attach IAM Role to Instance:
    • Go to the EC2 Console on AWS.
    • Select your EC2 instance, click on Actions → Security → Modify IAM Role.
    • Attach the GSS-Teradici IAM role to the instance.
  2. Connect to Your Windows Instance:
    • Use RDP to connect to your EC2 Windows instance.
    • Download the .rdp file and connect to the instance using your administrator credentials.
  3. Open PowerShell with AWS CLI:
    • Ensure the AWS CLI is installed on your instance. If not, download and install it from AWS CLI Installation Guide.
    • Open PowerShell.
  4. Set Up Environment Variables:
    • Define the S3 bucket and key prefix for the NVIDIA drivers in PowerShell:
    • Run the following PowerShell script to download the drivers from the S3 bucket:
    • This script will copy all files with the "latest" prefix from the ec2-windows-nvidia-drivers bucket to the specified local path on your instance.
  5. Install the Driver:
    • After the download completes, navigate to the NVIDIA folder on your desktop.
    • Run the driver installer and follow the prompts to complete the installation.
  6. Verify Installation:
    • Open Device Manager on the instance.
    • Confirm that the NVIDIA GPU appears under Display adapters.
    • Optionally, open the NVIDIA Control Panel to verify functionality.

$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

    }

}

After following these steps, your EC2 instance should be equipped with the NVIDIA drivers, allowing you to utilize the GPU capabilities for tasks like machine learning and graphics processing.

 

Resource - To install the NVIDIA GRID driver on your Windows instance