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.
Load nvidia-uvm at boot time and install nvidia-persistenced as syste…
…m service on GPU instances When running on a GPU instance, this commit loads kernel module of Nvidia unified virtual memory by default and install Nvidia persistence daemon as a system service. Nvidia unified virtual memory makes it easy to use memory on both CPU and GPU. Nvidia persistence daemon keeps GPU initialized, therefore shorten application startup latency. See reference: Nvidia-uvm: https://developer.nvidia.com/blog/unified-memory-cuda-beginners/ Nvidia persistence daemon: https://docs.nvidia.com/deploy/driver-persistence/index.html Signed-off-by: Hanwen <[email protected]>
- Loading branch information
1 parent
637319d
commit 97db18d
Showing
5 changed files
with
67 additions
and
0 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
1 change: 1 addition & 0 deletions
1
cookbooks/aws-parallelcluster-config/files/default/nvidia/nvidia.conf
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 @@ | ||
nvidia-uvm |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# Cookbook:: aws-parallelcluster | ||
# Recipe:: nvidia | ||
# | ||
# Copyright:: 2013-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the | ||
# License. A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if graphic_instance? && nvidia_installed? | ||
# Load kernel module Nvidia-uvm | ||
kernel_module 'nvidia-uvm' do | ||
action :load | ||
end | ||
# Make sure kernel module Nvidia-uvm is loaded at instance boot time | ||
cookbook_file 'nvidia.conf' do | ||
source 'nvidia/nvidia.conf' | ||
path '/etc/modules-load.d/nvidia.conf' | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
end | ||
# Make sure nvidia_persistenced is installed as a system service | ||
bash 'nvidia.run advanced' do | ||
cwd '/usr/share/doc/NVIDIA_GLX-1.0/samples' | ||
user 'root' | ||
group 'root' | ||
code <<-NVIDIA | ||
tar -xf nvidia-persistenced-init.tar.bz2 | ||
./nvidia-persistenced-init/install.sh | ||
NVIDIA | ||
end | ||
end |
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