Skip to content

Commit 4e12d53

Browse files
authored
Merge branch 'release-3.14' into wip/disable-wayland-on-ubuntu22+-314-followup
2 parents 610177e + 0cba39a commit 4e12d53

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste
1111
and achieve better performance at scale.
1212
- Load kernel module `drm_client_lib` before installation of NVIDIA driver, if available on the kernel.
1313
- Reduce dependency footprint by installing the package `sssd-common` rather than `sssd`.
14+
- Disable Wayland protocol in GDM3 for Ubuntu 22.04+ to force the use of Xorg on GPU instances running without a display.
1415
- Upgrade Slurm to version 24.11.7 (from 24.11.6).
1516
- Upgrade libjwt to version 1.18.4 (from 1.17.0) for all OSs except Amazon Linux 2.
1617
- Upgrade amazon-efs-utils to version 2.4.0 (from v2.3.1).

cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,62 @@ def optionally_disable_rnd
8282
end
8383
end
8484

85+
# Disable Wayland in GDM to ensure Xorg is used
86+
# This is required for Ubuntu 22.04+ where Wayland is the default
87+
# Without this, GDM won't start Xorg on headless GPU instances
88+
def disable_wayland
89+
bash 'Disable Wayland in GDM' do
90+
user 'root'
91+
code <<-DISABLEWAYLAND
92+
set -e
93+
if [ -f /etc/gdm3/custom.conf ]; then
94+
sed -i 's/#WaylandEnable=false/WaylandEnable=false/' /etc/gdm3/custom.conf
95+
# If the line doesn't exist at all, add it under [daemon] section
96+
if ! grep -q "^WaylandEnable=false" /etc/gdm3/custom.conf; then
97+
sed -i '/\\[daemon\\]/a WaylandEnable=false' /etc/gdm3/custom.conf
98+
fi
99+
fi
100+
DISABLEWAYLAND
101+
end
102+
end
103+
104+
# Override allow_gpu_acceleration to disable Wayland before starting X
105+
def allow_gpu_acceleration
106+
# Update the xorg.conf to set up NVIDIA drivers.
107+
# NOTE: --enable-all-gpus parameter is needed to support servers with more than one NVIDIA GPU.
108+
nvidia_xconfig_command = "nvidia-xconfig --preserve-busid --enable-all-gpus"
109+
nvidia_xconfig_command += " --use-display-device=none" if node['ec2']['instance_type'].start_with?("g2.")
110+
execute "Set up Nvidia drivers for X configuration" do
111+
user 'root'
112+
command nvidia_xconfig_command
113+
end
114+
115+
# dcvgl package must be installed after NVIDIA and before starting up X
116+
# DO NOT install dcv-gl on non-GPU instances, or will run into a black screen issue
117+
install_dcv_gl
118+
119+
# Disable Wayland to ensure GDM starts Xorg
120+
disable_wayland
121+
122+
# Configure the X server to start automatically when the Linux server boots and start the X server in background
123+
bash 'Launch X' do
124+
user 'root'
125+
code <<-SETUPX
126+
set -e
127+
systemctl set-default graphical.target
128+
systemctl isolate graphical.target &
129+
SETUPX
130+
end
131+
132+
# Verify that the X server is running
133+
execute 'Wait for X to start' do
134+
user 'root'
135+
command "pidof X || pidof Xorg"
136+
retries 10
137+
retry_delay 5
138+
end
139+
end
140+
85141
def post_install
86142
# ubuntu-desktop comes with NetworkManager. On a cloud instance NetworkManager is unnecessary and causes delay.
87143
# Instruct Netplan to use networkd for better performance

0 commit comments

Comments
 (0)