Unraid with an older NVIDIA GPU
Getting Vulkan working in the container on Unraid with a pre-595 NVIDIA driver (Pascal cards like the GTX 1050 Ti): host checks, the missing modeset device, and the template settings.
This is for someone running the container on Unraid with an older NVIDIA card, one that can't use driver 595 or newer. That mostly means Pascal cards (the GTX 10-series). Running the container lists 595.80 as the minimum, but these cards can still work on the 580 driver if you do a few steps by hand. It's been confirmed on a GTX 1050 Ti with driver 580.173.02, with the stream encoded on the card and PPSSPP and RetroArch running smoothly.
On driver 595 or newer, you can most likely skip this page. The newer driver and NVIDIA container toolkit (1.20.1 and later) handle these steps for you. See the selkies NVIDIA proprietary drivers section.
Commands marked "on the host" run in Unraid's own terminal (the >_ icon at the top of the web UI), not inside the container.
The GPU showing up doesn't mean it works
docker exec webstation nvidia-smi can list your card while games still
fail to draw. nvidia-smi only proves the container can see the GPU. Vulkan
(the graphics system most emulators draw with) needs more than that, and
it's what the steps below fix. The last step has a test that tells you
whether Vulkan works.
Check the NVIDIA driver settings on the host
On the host, run:
cat /sys/module/nvidia_drm/parameters/modeset
cat /sys/module/nvidia_drm/parameters/fbdev
lsmod | grep nvidiaThe first two should each print Y. The last one lists the NVIDIA driver
pieces that are loaded, and should include nvidia, nvidia_modeset,
nvidia_drm and nvidia_uvm.
Check for /dev/nvidia-modeset
This is the step that trips people up, and it was the actual fix in the confirmed setup. On the host, run:
ls -l /dev/nvidia*You need all four of these in the list:
/dev/nvidia0
/dev/nvidiactl
/dev/nvidia-uvm
/dev/nvidia-modesetWith older drivers, Unraid can load the modeset part of the driver (it
shows up as nvidia_modeset in the previous step) and still never create
the /dev/nvidia-modeset device file (the file the container uses to reach
that part of the driver). Without that file, Vulkan fails inside the
container even though nvidia-smi works fine.
Create it if it's missing
On the host, run:
nvidia-modprobe -m
ls -l /dev/nvidia-modesetThe second command should now show /dev/nvidia-modeset. If it says
nvidia-modprobe: command not found, check that the Nvidia Driver plugin
is installed.
It can disappear after a reboot
Unraid may not recreate this file when it restarts. If it's gone after a
reboot, have nvidia-modprobe -m run at startup. The standard Unraid way
to do that is a script in the User Scripts plugin set to run at array
start. Adding the line to /boot/config/go also works. It needs to exist before the container starts, or the
container won't start.
Add the Extra Parameters
Edit the container in Unraid, switch to Advanced View at the top right, and paste this into Extra Parameters:
--shm-size=2gb --gpus=all --runtime=nvidia --device=/dev/dri --device=/dev/nvidia-modesetWhat each part does:
--gpus=alland--runtime=nvidiahand the NVIDIA card to the container.--device=/dev/dripasses in the render node (a device file for the GPU) that the desktop draws with.--device=/dev/nvidia-modesetpasses in the file from the previous step. On this driver, nothing adds it for you.--shm-size=2gbgives the browser, desktop and emulators more shared memory to work with. It won't make games faster, but it can prevent crashes from running out of it.
Add the environment variables
Still in the template, add these three variables (Add another Path, Port, Variable, Label or Device at the bottom, then pick Variable):
| Name | Value |
|---|---|
NVIDIA_DRIVER_CAPABILITIES | all |
NVIDIA_VISIBLE_DEVICES | Your card's ID. Run nvidia-smi -L on the host and copy the part that starts with GPU-. |
PIXELFLUX_WAYLAND | true |
Apply, and let the container restart. To double-check what it picked up:
docker inspect webstation --format '{{range .Config.Env}}{{println .}}{{end}}' \
| grep -E 'NVIDIA|PIXELFLUX'Check that it worked
Open the container's log. You're looking for two lines saying the stream is being encoded on your NVIDIA card:
[Wayland] Encoder: NVENC H264 4:2:0 on NVIDIA GeForce GTX 1050 Ti (render node 0, nvidia driver).
[Wayland] Zero-copy capture: output 1 1280x720 rendered on /dev/dri/renderD128, encoded in place on NVENC.The stats in the stream's sidebar show the same thing.
That proves the stream works, not the emulators, so test Vulkan too. On the host, run:
docker exec webstation bash -c '
unset DISPLAY
unset WAYLAND_DISPLAY
unset XDG_RUNTIME_DIR
export VK_DRIVER_FILES=/etc/vulkan/icd.d/nvidia_icd.json
vulkaninfo --summary
RC=$?
echo
echo "EXIT=$RC"
'The unset lines keep the desktop (Wayland or X11) out of the test, so
you're checking the driver and nothing else. VK_DRIVER_FILES makes Vulkan
load only the NVIDIA driver. Without it, Vulkan can quietly fall back to a
software renderer and the test looks like it passed.
When it works, your card shows up under Devices:
Devices:
========
GPU0:
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName = NVIDIA GeForce ...
driverName = NVIDIA
driverInfo = ...and the last line is EXIT=0. If it crashes, lists no NVIDIA card, or
ends with any other number, Vulkan still isn't working. Check
/dev/nvidia-modeset again first. That was
the fix in the confirmed setup.
If you switched any emulators to OpenGL to get around broken Vulkan, you can switch them back now. Vulkan usually runs them faster.