diff --git a/airootfs/etc/systemd/system/nvidia-pstated.service b/airootfs/etc/systemd/system/nvidia-pstated.service index 098ee27..071bd78 100644 --- a/airootfs/etc/systemd/system/nvidia-pstated.service +++ b/airootfs/etc/systemd/system/nvidia-pstated.service @@ -4,6 +4,8 @@ Description=A daemon that automatically manages the performance states of NVIDIA [Service] DynamicUser=yes ExecStart=/usr/local/bin/nvidia-pstated +Restart=always +RestartSec=1s [Install] WantedBy=multi-user.target diff --git a/airootfs/etc/udev/rules.d/99-nvidia-pstated.rules b/airootfs/etc/udev/rules.d/99-nvidia-pstated.rules new file mode 100644 index 0000000..066ba28 --- /dev/null +++ b/airootfs/etc/udev/rules.d/99-nvidia-pstated.rules @@ -0,0 +1,11 @@ +# NVIDIA Tesla P100 12 GB +SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x15f7", ACTION=="add", RUN+="/usr/bin/systemctl start nvidia-pstated.service" + +# NVIDIA Tesla P100 16 GB +SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x15f8", ACTION=="add", RUN+="/usr/bin/systemctl start nvidia-pstated.service" + +# NVIDIA Tesla P40 24 GB +SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x1b38", ACTION=="add", RUN+="/usr/bin/systemctl start nvidia-pstated.service" + +# NVIDIA Tesla P4 8 GB +SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x1bb3", ACTION=="add", RUN+="/usr/bin/systemctl start nvidia-pstated.service" diff --git a/airootfs/root/customize_airootfs.sh.jinja2 b/airootfs/root/customize_airootfs.sh.jinja2 index c6df613..f054639 100644 --- a/airootfs/root/customize_airootfs.sh.jinja2 +++ b/airootfs/root/customize_airootfs.sh.jinja2 @@ -27,9 +27,6 @@ chmod +x "/usr/local/bin/nvidia-pstated" # enable nvidia-persistenced service systemctl enable nvidia-persistenced - -# enable nvidia-pstated service -systemctl enable nvidia-pstated {% endif %} {% if type == "gui" %}