Knowledge Center Monthly Newsletter - July 2025
Stay up to date with the latest from the Knowledge Center. See all new Knowledge Center articles published in the last month, and re:Post’s top contributors.
Deep Learning graphical desktop on Amazon Linux 2023 (AL2023) with AWS Deep Learning AMI (DLAMI)
Setup a deep learning workstation running Amazon Linux 2023 based on Deep Learning AMI (DLAMI)
Overview
AWS Deep Learning AMIs (DLAMI) provides ML practitioners and researchers with a curated and secure set of frameworks, dependencies, and tools to accelerate deep learning (DL) on Amazon EC2. The GPU AMIs supports NVIDIA GPU instance types and are preinstalled with NVIDIA driver and software such as CUDA Toolkit, NCCL, cuDNN, Docker and NVIDIA Container Toolkit. Neuron Deep Learning AMIs supports Inferentia and Trainium instance types and are pre-installed with Neuron SDK.
This article suggest how you can create a DL graphical desktop EC2 instance running Amazon Linux 2023 that is based on DLAMI with Amazon DCV server for remote graphical access, and with GPU accelerated graphics (for NVIDIA GPU instance types). For Ubuntu Linux, refer to this article.
For this article, we will use g4dn.xlarge
to launch Deep Learning OSS Nvidia Driver AMI GPU PyTorch 2.7 (Amazon Linux 2023)
AMI in us-west-2 (Oregon)
Region.
Notice
Your use of DCV is subject to DCV End User License Agreement (EULA).
Prerequisites
- Go to Deep Learning AMIs Release Notes or Neuron DLAMI User Guide to browse and choose the
Amazon Linux 2023
AMI to launch.
-
For the desired AMI, view release notes details. Note the following values
- AMI name : e.g.
Deep Learning OSS Nvidia Driver AMI GPU PyTorch 2.7 (Amazon Linux 2023)
- Supported EC2 instances : e.g.
G4dn, G5, G6, Gr6, G6e, P4d, P4de, P5, P5e, P5en, P6-B200
- AMI name : e.g.
-
Go to Amazon EC2 instance types by Region. Determine what supported EC2 instance types are available in your AWS Region in Accelerated Computing section
- Go to EC2 console of your desired Region, Instance types. Filter by your instance type family, e.g.
g4dn
-
For the desired instance size, note the following
- Availability Zones (and if applicable Local Zone) : e.g.
us-west-2a, us-west-2b, us-west-2c
but notus-west-2d
AZ, andus-west-2-lax
US West (Los Angeles) LZ - vCPUs : e.g.
4
for g4dn.xlarge
- Availability Zones (and if applicable Local Zone) : e.g.
-
Go to Service Quotas console of your desired Region to verify On-Demand Instance quota value of your desired instance type as follows.
- G instance types: Running On-Demand G and VT instances
- P instance types: Running On-Demand P instances
- INF instance types: Running On-Demand Inf instances
- TRN instance types: Running On-Demand Trn instances
Request quota increase if the assigned value is less than vCPU count of your desired EC2 instance size. Do not proceed until your applied quota value is equal or higher than your instance type vCPUs count
Prepare Amazon Linux 2023
Go to EC2 console to launch EC2 instance. Search for and select your DLAMI. You can search by AMI name, e.g. Deep Learning OSS Nvidia Driver AMI GPU PyTorch
.
You may have to search Community AMIs section. Some Regions may not support DLAMI.
Ensure the following
- Supported instance type, e.g.
g4dn.xlarge
- Attached security group allows inbound TCP and UDP port
8443
from your IP - Attached EC2 IAM role with the below custom policy for DCV license validation. Replace
REGION
with your instance AWS Region code. Alternatively, attach AmazonS3ReadOnlyAccess managed policy. Also attach AmazonSSMManagedInstanceCore and CloudWatchAgentServerPolicy managed policies for management and monitoring.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::dcv-license.REGION/*"
}
]
}
Connect to your instance as ec2-user
Set user password
Specify a strong password for ec2-user
sudo passwd ec2-user
Install graphical desktop and Amazon DCV
Run the following script to install graphical desktop environment and Amazon DCV server. Script will restart your instance upon completion
#!/bin/bash
sudo dnf groupinstall "Desktop" -y
sudo sed -i '/^\[daemon\]/a WaylandEnable=false' /etc/gdm/custom.conf
sudo systemctl set-default graphical.target
cd /tmp
sudo rpm --import https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY
curl -L -O https://d1uj6qtbmh3dt5.cloudfront.net/nice-dcv-amzn2023-$(arch).tgz
tar -xvzf nice-dcv-amzn2023-$(arch).tgz && cd nice-dcv-*-amzn2023-$(arch)
sudo dnf install -y ./nice-dcv-server-*.rpm
sudo dnf install -y ./nice-dcv-web-viewer-*.rpm
sudo dnf install -y ./nice-xdcv-*.rpm
if (arch | grep -q x86); then
sudo dnf install -y ./nice-dcv-gltest-*.rpm
fi
sudo systemctl enable dcvserver
sudo sed -i "/^\[session-management\/automatic-console-session/a owner=\"ec2-user\"\nstorage-root=\"%home%\"" /etc/dcv/dcv.conf
sudo sed -i "s/^#create-session/create-session/g" /etc/dcv/dcv.conf
sudo dnf install -y cups
sudo usermod -a -G sys dcv
sudo systemctl enable --now cups
sudo dnf install -y xorg-x11-drv-dummy
sudo tee /etc/X11/xorg.conf > /dev/null << EOF
Section "Device"
Identifier "DummyDevice"
Driver "dummy"
Option "UseEDID" "false"
VideoRam 512000
EndSection
Section "Monitor"
Identifier "DummyMonitor"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
Option "ReducedBlanking"
EndSection
Section "Screen"
Identifier "DummyScreen"
Device "DummyDevice"
Monitor "DummyMonitor"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Virtual 4096 2160
EndSubSection
EndSection
EOF
DLAMI=$(grep -rl "Deep Learning" /etc/update-motd.d/*)
mkdir -p /home/ec2-user/Desktop
. $DLAMI > /home/ec2-user/Desktop/README.md
if [ -f /usr/bin/nvidia-xconfig ]; then
sudo /usr/bin/nvidia-xconfig --preserve-busid --enable-all-gpus
sudo dnf install -y vulkan-tools glx-utils
sudo systemctl enable --now dlami-cloudwatch-agent@partial
fi
sudo reboot
Access graphical desktop environment
DCV offers Windows, Linux, macOS and web browser clients.
You can connect to DCV server using web browser client at https://<EC2-IP>
:8443 (where <EC2-IP>
is your EC2 instance IP address).
Native clients provide better user experience and additional features, and can be downloaded from Amazon DCV site.
Login as ec2-user
with your configured password
Do ensure that EC2 instance security group allow inbound TCP and UDP 8443 from your IP
DLAMI notes
DLAMI notes can be located at /home/ec2-user/Desktop/README.md
NVIDIA graphics acceleration
If you are using a NVIDIA GPU instance type, run the following command to verify that X Windows is using GPU for graphics acceleration
nvidia-smi
Verify that nvidia-smi Processes
list output includes Xorg
(for graphical desktop acceleration). To verify Vulkan and OpenGL GPU acceleration, you can run vkcube
and dcvgltest
(x86_64 only) and check nvidia-smi process listing.
NVIDIA driver type
DLAMI uses Tesla (also know as NVIDIA Data Center GPU) driver which support one display of up to 2560x1600 resolution. GRID drivers provide access to four 4K displays per GPU and are certified to provide optimal performance for professional visualization applications. To setup a DL workstation with GRID driver, you can refer to documentation or article GPU-accelerated graphical desktop on Amazon Linux 2023 (AL2023) with NVIDIA GRID and Amazon DCV
Documentation
Refer to DLAMI Developer Guide/Neuron SDK and Amazon DCV User Guide for usage guidance
Other install options
- Consider Amazon SageMaker if you want a fully managed Deep Learning experience
- Managed EUC (End User Computing) services such as Amazon WorkSpaces and Amazon AppStream 2.0 offers graphics accelerated options
- Amazon Machine Images (AMIs) with NVIDIA GRID drivers installed are available from AWS MarketPlace
- Install desktop environment, NVIDIA GRID driver and Amazon DCV Server from documentation
- Use this repository CloudFormation templates to automate NVIDIA Tesla or GRID driver and DCV server setup on AL2023, Ubuntu or other OSs, or automate DLAMI Desktop setup
- Language
- English
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago