2024-09-02 04:03:12 +02:00
|
|
|
# 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. In the case where vfio-pci is used
|
|
|
|
# nvidia-modprobe should not be invoked.
|
|
|
|
ACTION=="add|bind", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", \
|
|
|
|
DRIVER=="nvidia", TEST!="/dev/nvidia-uvm", \
|
|
|
|
RUN+="/usr/bin/nvidia-modprobe", \
|
2024-09-02 10:30:07 +02:00
|
|
|
RUN+="/usr/bin/bash -c 'for i in $(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \ -f 4); do /usr/bin/nvidia-modprobe -c${i} && /usr/bin/nvidia-modprobe -s -c${i}; done'", \
|
2024-09-02 04:03:12 +02:00
|
|
|
RUN+="/usr/bin/nvidia-modprobe -l -m", \
|
|
|
|
RUN+="/usr/bin/nvidia-modprobe -c0 -u", \
|
|
|
|
RUN+="/usr/bin/nvidia-smi"
|
2024-07-24 03:30:09 +02:00
|
|
|
|
2024-09-02 04:03:12 +02:00
|
|
|
# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
|
|
|
|
ACTION=="add|bind", SUBSYSTEM=="pci", DRIVERS=="nvidia", ATTR{vendor}=="0x10de", \
|
|
|
|
ATTR{class}=="0x03[0-9]*", TEST=="power/control", ATTR{power/control}="auto"
|
|
|
|
|
|
|
|
# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
|
|
|
|
ACTION=="remove|unbind", SUBSYSTEM=="pci", DRIVERS=="nvidia", ATTR{vendor}=="0x10de", \
|
2024-09-02 10:30:07 +02:00
|
|
|
ATTR{class}=="0x03[0-9]*", TEST=="power/control", ATTR{power/control}="on"
|