-
Notifications
You must be signed in to change notification settings - Fork 111
[Build] Install the NVIDIA driver and CUDA toolkit from the distribution package manager using NVIDIA local repo packages instead of the run file installers. #3207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gmarciani
wants to merge
2
commits into
aws:develop
Choose a base branch
from
gmarciani:wip/mgiacomo/3160/install-nvidia-0619-1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
83 changes: 0 additions & 83 deletions
83
cookbooks/aws-parallelcluster-platform/recipes/install/cuda.rb
This file contains hidden or 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,83 +0,0 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # | ||
| # Cookbook:: aws-parallelcluster | ||
| # Recipe:: cuda | ||
| # | ||
| # Copyright:: 2013-2022 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. | ||
|
|
||
| return unless nvidia_enabled? | ||
|
|
||
| # Cuda installer from https://developer.nvidia.com/cuda-toolkit-archive | ||
| # Cuda installer naming: cuda_11.8.0_520.61.05_linux | ||
|
|
||
| cuda_full_version = node['cluster']['nvidia']['cuda']['version'] | ||
| cuda_parts = cuda_full_version.split('.') | ||
| cuda_version = "#{cuda_parts[0]}.#{cuda_parts[1]}" | ||
| cuda_version_suffix = node['cluster']['nvidia']['cuda']['driver_version_suffix'] | ||
| cuda_samples_version = cuda_version | ||
| cuda_arch = arm_instance? ? 'linux_sbsa' : 'linux' | ||
| cuda_url = "#{node['cluster']['nvidia']['cuda']['base_url']}/cuda_#{cuda_full_version}_#{cuda_version_suffix}_#{cuda_arch}.run" | ||
| cuda_samples_url = "#{node['cluster']['nvidia']['cuda']['samples_base_url']}/v#{cuda_samples_version}.tar.gz" | ||
| tmp_cuda_run = '/tmp/cuda.run' | ||
| tmp_cuda_sample_archive = '/tmp/cuda-sample.tar.gz' | ||
|
|
||
| # Save resolved CUDA versions to .default so InSpec/build-image tests which run during ParallelClusterTestComponent see them (mirrors Nvidia driver). | ||
| node.default['cluster']['nvidia']['cuda']['version'] = cuda_full_version | ||
| node.default['cluster']['nvidia']['cuda_samples_version'] = cuda_samples_version | ||
| node_attributes 'Save cuda and cuda samples versions for InSpec tests' | ||
|
|
||
| # Get CUDA run file | ||
| remote_file tmp_cuda_run do | ||
| source cuda_url | ||
| mode '0755' | ||
| retries 3 | ||
| retry_delay 5 | ||
| not_if { ::File.exist?("/usr/local/cuda-#{cuda_version}") } | ||
| end | ||
|
|
||
| # Install CUDA driver | ||
| bash 'cuda.run advanced' do | ||
| user 'root' | ||
| group 'root' | ||
| cwd '/tmp' | ||
| code <<-CUDA | ||
| set -e | ||
| mkdir /cuda-install | ||
| ./cuda.run --silent --toolkit --samples --tmpdir=/cuda-install | ||
| rm -rf /cuda-install | ||
| rm -f /tmp/cuda.run | ||
| CUDA | ||
| creates "/usr/local/cuda-#{cuda_version}" | ||
| end | ||
|
|
||
| # Get CUDA Sample Files | ||
| remote_file tmp_cuda_sample_archive do | ||
| source cuda_samples_url | ||
| mode '0644' | ||
| retries 3 | ||
| retry_delay 5 | ||
| not_if { ::File.exist?("/usr/local/cuda-#{cuda_version}/samples") } | ||
| end | ||
|
|
||
| # Unpack CUDA Samples | ||
| bash 'cuda.sample install' do | ||
| user 'root' | ||
| group 'root' | ||
| cwd '/tmp' | ||
| code <<-CUDA | ||
| set -e | ||
| tar xf "/tmp/cuda-sample.tar.gz" --directory "/usr/local/" | ||
| rm -f "/tmp/cuda-sample.tar.gz" | ||
| CUDA | ||
| creates "/usr/local/cuda-#{cuda_version}/samples" | ||
| end | ||
This file contains hidden or 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 hidden or 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
19 changes: 19 additions & 0 deletions
19
cookbooks/aws-parallelcluster-platform/resources/nvidia_cuda/nvidia_cuda_alinux2023.rb
This file contains hidden or 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,19 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Copyright:: 2026 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. | ||
|
|
||
| provides :nvidia_cuda, platform: 'amazon' do |node| | ||
| node['platform_version'].to_i == 2023 | ||
| end | ||
|
|
||
| use 'partial/_nvidia_cuda_common.rb' |
19 changes: 19 additions & 0 deletions
19
cookbooks/aws-parallelcluster-platform/resources/nvidia_cuda/nvidia_cuda_redhat8+.rb
This file contains hidden or 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,19 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Copyright:: 2026 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. | ||
|
|
||
| provides :nvidia_cuda, platform: 'redhat' do |node| | ||
| node['platform_version'].to_i >= 8 | ||
| end | ||
|
|
||
| use 'partial/_nvidia_cuda_common.rb' |
19 changes: 19 additions & 0 deletions
19
cookbooks/aws-parallelcluster-platform/resources/nvidia_cuda/nvidia_cuda_rocky8+.rb
This file contains hidden or 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,19 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Copyright:: 2026 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. | ||
|
|
||
| provides :nvidia_cuda, platform: 'rocky' do |node| | ||
| node['platform_version'].to_i >= 8 | ||
| end | ||
|
|
||
| use 'partial/_nvidia_cuda_common.rb' |
19 changes: 19 additions & 0 deletions
19
cookbooks/aws-parallelcluster-platform/resources/nvidia_cuda/nvidia_cuda_ubuntu22+.rb
This file contains hidden or 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,19 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Copyright:: 2026 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. | ||
|
|
||
| provides :nvidia_cuda, platform: 'ubuntu' do |node| | ||
| node['platform_version'].to_i >= 22 | ||
| end | ||
|
|
||
| use 'partial/_nvidia_cuda_common.rb' |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.