Use separate rendering and encoding GPUs
When scaling Steam Headless to host multiple concurrent gaming sessions, dedicating separate physical graphics processors (GPUs) to individual containers eliminates resource contention, prevents video memory (VRAM) exhaustion, and ensures deterministic frame pacing.
This guide explains how to identify physical GPU topology on your Linux host, how to assign dedicated GPUs to specific containers, and how to configure heterogeneous combinations of Intel, AMD, and NVIDIA hardware in Docker Compose.
Why dedicate GPUs across containers?
While modern Linux DRM drivers allow multiple containers to share a single GPU render node, dedicated GPU allocation offers distinct advantages for multi-seat gaming:
- VRAM isolation: Modern AAA titles frequently allocate 6 GB to 10+ GB of VRAM. If two games sharing a 12 GB GPU exceed available VRAM, textures are evicted to system RAM over the PCIe bus, introducing severe micro-stuttering.
- Dedicated video encode engines: Video encoding hardware (Intel VA-API, AMD VCN, NVIDIA NVENC) has fixed throughput ceilings. Dedicating a physical card ensures that heavy gameplay capture does not delay encoding for other players.
- Optimised architecture utilisation: Homelab servers often pair a low-power CPU with an integrated GPU (such as Intel UHD Graphics) alongside a high-performance discrete PCIe card or external Thunderbolt eGPU. You can allocate casual desktop tasks or 2D games to the iGPU while reserving the discrete card for high-end 3D titles.
Discovering and identifying host GPUs
Linux assigns device nodes under /dev/dri/ dynamically at boot. To ensure consistent device mapping across system reboots, discover the underlying PCI bus addresses.
1. Inspect PCI graphics hardware
Run lspci to list all display controllers on the host:
lspci -nnk | grep -iA3 -E "vga|3d|display"
Example output:
00:02.0 VGA compatible controller [0300]: Intel Corporation Iris Pro Graphics 580 [8086:193b] (rev 09)
Subsystem: Intel Corporation Device [8086:2064]
Kernel driver in use: i915
--
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 24 [Radeon RX 6400] [1002:743f] (rev c7)
Subsystem: Sapphire Technology Limited Device [1da2:e442]
Kernel driver in use: amdgpu
--
40:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106 [GeForce RTX 2060] [10de:1f08] (rev a1)
Subsystem: Razer USA Ltd. Device [1532:0005]
Kernel driver in use: nvidia
2. Map PCI slots to DRM render nodes
Inspect /dev/dri/by-path/ to determine the exact device nodes associated with each PCI identifier:
ls -l /dev/dri/by-path/
Example output:
lrwxrwxrwx 1 root root 8 Sep 11 00:00 pci-0000:00:02.0-card -> ../card0
lrwxrwxrwx 1 root root 13 Sep 11 00:00 pci-0000:00:02.0-render -> ../renderD128
lrwxrwxrwx 1 root root 8 Sep 11 00:00 pci-0000:01:00.0-card -> ../card1
lrwxrwxrwx 1 root root 13 Sep 11 00:00 pci-0000:01:00.0-render -> ../renderD129
lrwxrwxrwx 1 root root 8 Sep 11 00:00 pci-0000:40:00.0-card -> ../card2
lrwxrwxrwx 1 root root 13 Sep 11 00:00 pci-0000:40:00.0-render -> ../renderD130
From this mapping, we establish:
- Intel Iris Pro iGPU: Render node
/dev/dri/renderD128 - AMD Radeon RX 6400: Render node
/dev/dri/renderD129 - NVIDIA RTX 2060 eGPU: Render node
/dev/dri/renderD130
In Docker Compose, you can map device symlinks directly (e.g. /dev/dri/by-path/pci-0000:01:00.0-render:/dev/dri/renderD128). This guarantees that the correct physical GPU is assigned to each container even if the kernel re-indexes /dev/dri/renderD* numbers after a kernel update or hardware change.
Split rendering and encoding within one container
Map both render nodes into the container when you want KWin to render the desktop on one GPU while the browser streaming engine and Sunshine encode on another. Choose each node with the compositor and encoder device options:
services:
desktop:
environment:
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD129'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD128'
devices:
- /dev/dri/renderD129:/dev/dri/renderD129
- /dev/dri/renderD128:/dev/dri/renderD128
For a normal single-GPU setup, map one render node and leave both options empty. Steam Headless uses that node for KWin, the web interface, and Sunshine automatically.
Steam Headless manages Sunshine's renderer on every container boot by default. Follow the SUNSHINE_ENABLE_AUTO_CONFIG option if you want to choose a different GPU in Sunshine's interface.
Vendor-specific configuration guidelines
Intel and AMD containers (Pure render node mapping)
For Intel and AMD graphics cards, the container requires access only to the DRM render node:
- No primary card node required: Do not map
/dev/dri/card*. KWin's virtual Wayland backend operates entirely off-screen using GBM/EGL allocated via the render node. - Remapping inside the container: You can map any host render node (such as
/dev/dri/renderD129) to/dev/dri/renderD128inside the container. This maintains container internal consistency while isolating hardware. - Hardware video encoding:
- Intel uses the VA-API
iHDori965driver. - AMD uses the Mesa
radeonsiVA-API driver. GStreamer operates viavah264encwith zero-latency profile tuning (b-frames=0 ref-frames=1).
- Intel uses the VA-API
NVIDIA containers (Container toolkit & modesetting)
Configuring an NVIDIA GPU (whether internal PCIe or an external Thunderbolt 3 eGPU) involves specific architectural requirements:
-
Host Kernel Mode Setting (
nvidia_drm.modeset=1): The host NVIDIA kernel module must be loaded with modesetting enabled.- On Fedora Server / Ubuntu Server / Debian Server: Create
/etc/modprobe.d/nvidia-modeset.confcontainingoptions nvidia-drm modeset=1and regenerate the initramfs (dracut -forupdate-initramfs -u). - On TrueNAS SCALE: Configure via the CLI:
midclt call system.advanced.update '{"kernel_extra_options": "nvidia_drm.modeset=1"}'
Missing modeset=1 failure modeIf
nvidia_drm.modeset=1is omitted, KWin cannot initialise the NVIDIA GBM allocator (libnvidia-allocator.so). Mesa falls back to software rasterisation (kms_swrast), generating repeatedDRM_IOCTL_MODE_CREATE_DUMB failed: Permission deniederrors and degrading streaming responsiveness. - On Fedora Server / Ubuntu Server / Debian Server: Create
-
Render Node: Map the NVIDIA DRM render node, such as
/dev/dri/renderD130. Do not map a/dev/dri/card*primary node; Steam Headless removes primary card nodes before starting the desktop. -
NVIDIA Container Runtime: The service definition must specify
runtime: nvidia(or Docker's CDI device reservations) and include the NVIDIA container options. The toolkit injects the host-created/dev/nvidia*devices into the container. -
NVENC Ultra-Low Latency Tuning: The browser streaming engine automatically configures GStreamer's
nvh264encwithpreset=p4 tune=ultra-low-latency b-frames=0 zerolatency=true. This constrains the H.264 Decoded Picture Buffer (DPB) to 1 frame, preventing client browser decoders from buffering frames in hardware.
Multi-GPU Docker Compose configuration
The following complete docker-compose.yml demonstrates three containers operating concurrently on three separate physical GPUs. Use the container options reference when changing settings that are not specific to this GPU layout.
name: steam-headless-multigpu
x-common-container: &common-container
image: josh5/steam-headless:2
privileged: false
cap_add:
- DAC_READ_SEARCH
- NET_ADMIN
- SYS_ADMIN
- SYS_NICE
- SYS_PTRACE
security_opt:
- seccomp=unconfined
- systempaths=unconfined
- writable-cgroups=true
cgroup: private
stop_signal: SIGRTMIN+3
stop_grace_period: 30s
pids_limit: 8192
shm_size: 2gb
device_cgroup_rules:
- 'c 13:* rwm'
tmpfs:
- /run
- /run/lock
- /tmp
- /dev/input:rw,dev,mode=0755
restart: unless-stopped
services:
# =========================================================================
# Container A: Dedicated Intel Iris Pro / Arc iGPU (/dev/dri/renderD128)
# =========================================================================
desktop-intel:
<<: *common-container
container_name: steam-headless-intel
hostname: steam-headless-intel
environment:
PUID: '1000'
PGID: '1000'
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD128'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD128'
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- steam-headless-intel-state:/var/lib/steam-headless
- steam-headless-intel-journal:/var/log/journal
- ./data/homes/container-intel:/home/steamheadless:Z
- ./data/games:/mnt/games:z
networks:
session-lan:
ipv4_address: 192.168.1.50
# =========================================================================
# Container B: Dedicated AMD Radeon RX 6400 (/dev/dri/renderD129)
# =========================================================================
desktop-amd:
<<: *common-container
container_name: steam-headless-amd
hostname: steam-headless-amd
environment:
PUID: '1000'
PGID: '1000'
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD129'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD129'
devices:
- /dev/dri/renderD129:/dev/dri/renderD129
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- steam-headless-amd-state:/var/lib/steam-headless
- steam-headless-amd-journal:/var/log/journal
- ./data/homes/container-amd:/home/steamheadless:Z
- ./data/games:/mnt/games:z
networks:
session-lan:
ipv4_address: 192.168.1.51
# =========================================================================
# Container C: Dedicated NVIDIA GeForce RTX 2060 (/dev/dri/renderD130)
# =========================================================================
desktop-nvidia:
<<: *common-container
container_name: steam-headless-nvidia
hostname: steam-headless-nvidia
runtime: nvidia
environment:
PUID: '1000'
PGID: '1000'
COMPOSITOR_RENDER_DEVICE: '/dev/dri/renderD130'
ENCODER_RENDER_DEVICE: '/dev/dri/renderD130'
NVIDIA_VISIBLE_DEVICES: 'all'
NVIDIA_DRIVER_CAPABILITIES: 'all'
devices:
- /dev/dri/renderD130:/dev/dri/renderD130
- /dev/fuse:/dev/fuse
- /dev/uinput:/dev/uinput
- /dev/uhid:/dev/uhid
volumes:
- /etc/localtime:/run/host-localtime:ro
- /sys/devices/virtual/input:/sys/devices/virtual/input:ro
- steam-headless-nvidia-state:/var/lib/steam-headless
- steam-headless-nvidia-journal:/var/log/journal
- ./data/homes/container-nvidia:/home/steamheadless:Z
- ./data/games:/mnt/games:z
networks:
session-lan:
ipv4_address: 192.168.1.52
networks:
session-lan:
driver: macvlan
driver_opts:
parent: eth0
macvlan_mode: bridge
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
aux_addresses:
host-shim: 192.168.1.99
volumes:
steam-headless-intel-state:
steam-headless-intel-journal:
steam-headless-amd-state:
steam-headless-amd-journal:
steam-headless-nvidia-state:
steam-headless-nvidia-journal:
Verifying GPU acceleration and monitoring performance
Once the containers are running, verify that each container is actively utilising its assigned GPU:
1. Execute in-container capability checks
Run Vulkan and VA-API checks inside each container:
# Check Intel container
docker exec steam-headless-intel vulkaninfo --summary
docker exec steam-headless-intel vainfo --display drm --device /dev/dri/renderD128
# Check AMD container
docker exec steam-headless-amd vulkaninfo --summary
docker exec steam-headless-amd vainfo --display drm --device /dev/dri/renderD128
# Check NVIDIA container
docker exec steam-headless-nvidia nvidia-smi
2. Monitor host GPU utilisation during active streaming
On the host, use GPU-specific monitoring utilities to verify independent load:
- Intel GPUs: Run
sudo intel_gpu_topto monitor Render/3D and Video Enhance (encoding) engine utilisation. - AMD GPUs: Run
radeontopto monitor Graphics and VCN Video Core activity. - NVIDIA GPUs: Run
watch -n 1 nvidia-smito monitor GPU compute utilisation, encoder engine load (Enc), and memory footprint.