summarylogtreecommitdiffstats
path: root/nvidia.rules
diff options
context:
space:
mode:
Diffstat (limited to 'nvidia.rules')
-rw-r--r--nvidia.rules11
1 files changed, 6 insertions, 5 deletions
diff --git a/nvidia.rules b/nvidia.rules
index 1334f88ca2d5..1876f3e2b286 100644
--- a/nvidia.rules
+++ b/nvidia.rules
@@ -1,5 +1,6 @@
-# Device nodes are created by nvidia-modprobe, which is called by the nvidia DDX.
-# In case the DDX is not started, the device nodes are never created, so call
-# nvidia-modprobe in the udev rules to cover the Wayland/EGLStream and compute
-# case without a started display.
-KERNEL=="nvidia", DRIVER=="nvidia", RUN+="/usr/bin/nvidia-modprobe", RUN+="/usr/bin/nvidia-modprobe -u"
+# Make sure device nodes are present even when the DDX is not started for the Wayland/EGLStream case
+KERNEL=="nvidia", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidiactl c $$(grep nvidia /proc/devices | cut -d \ -f 1) 255'"
+KERNEL=="nvidia", RUN+="/usr/bin/bash -c 'for i in $$(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \ -f 4); do /usr/bin/mknod -Z -m 666 /dev/nvidia$${i} c $$(grep nvidia /proc/devices | cut -d \ -f 1) $${i}; done'"
+KERNEL=="nvidia_modeset", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-modeset c $$(grep nvidia /proc/devices | cut -d \ -f 1) 254'"
+KERNEL=="nvidia_uvm", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-uvm c $$(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'"
+KERNEL=="nvidia_uvm", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-uvm-tools c $$(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 1'"