forked from aws/aws-parallelcluster-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace nvidia-persistenced with parallelcluster_nvidia service
`parallelcluster_nvidia` service ensures the creation of the block devices `/dev/nvidia0` and it is needed by the `slurmd` service. `parallelcluster_nvidia` starts the `nvidia-persistenced` or runs `nvidia-smi` to avoid race condition with other services and avoids conflicts when using DLAMI with a gpu instance. ### Tests * Modified ChefSpec to verify new changes. ### References Backport of: aws#2341 Signed-off-by: Enrico Usai <usai@amazon.com>
- Loading branch information
1 parent
cadadea
commit 1eb92b7
Showing
8 changed files
with
101 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
cookbooks/aws-parallelcluster-platform/templates/nvidia/parallelcluster_nvidia_service.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This systemd service file, designed to trigger the creation device block file /dev/nvidia0 | ||
# The service start nvidia-persistenced if it is not already started or execute the command nvidia-smi. | ||
|
||
[Unit] | ||
Description=ParallelCluster NVIDIA Daemon | ||
Wants=syslog.target | ||
|
||
[Service] | ||
<% if @is_nvidia_persistenced_running -%> | ||
Type=simple | ||
ExecStart=/usr/bin/nvidia-smi | ||
RemainAfterExit=yes | ||
<% else %> | ||
Type=forking | ||
ExecStart=/usr/bin/nvidia-persistenced --user root | ||
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced | ||
<% end %> | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...parallelcluster-slurm/templates/default/slurm/compute/slurmd_nvidia_persistenced.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[Unit] | ||
After=nvidia-persistenced.service | ||
Wants=nvidia-persistenced.service | ||
After=parallelcluster_nvidia.service | ||
Wants=parallelcluster_nvidia.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters