Skip to content

Commit

Permalink
[misc] Start nvidia-pstated only when Tesla P100/P40/P4 present
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Jul 27, 2024
1 parent 6408517 commit df2de8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions airootfs/etc/systemd/system/nvidia-pstated.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions airootfs/etc/udev/rules.d/99-nvidia-pstated.rules
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 0 additions & 3 deletions airootfs/root/customize_airootfs.sh.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down

0 comments on commit df2de8e

Please sign in to comment.