Skip to content

Commit cc61ed3

Browse files
committed
Adds bandwidth.yml playbook to download, build, and run nvbandwidth.
bandwidth.yml is ran via cudatests.yml
1 parent 81a2581 commit cc61ed3

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

ansible/adhoc/cudatests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
- ansible.builtin.import_role:
88
name: cuda
99
tasks_from: samples.yml
10+
11+
- name: Run CUDA bandwidth tasks
12+
ansible.builtin.import_role:
13+
name: cuda
14+
tasks_from: bandwidth.yml

ansible/roles/cuda/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ cuda_samples_programs:
1616
- bandwidthTest
1717
# cuda_devices: # discovered from deviceQuery run
1818
cuda_persistenced_state: started
19+
# variables for nvbandwidth (for bandwidth.yml tasks run in cudatests.yml)
20+
cuda_bandwidth_path: "/var/lib/{{ ansible_user }}/cuda_bandwidth"
21+
cuda_bandwidth_release_url: "https://github.com/NVIDIA/nvbandwidth/archive/refs/tags/v0.8.tar.gz"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
- name: Ensure cuda_bandwidth_path exists
3+
ansible.builtin.file:
4+
state: directory
5+
path: "{{ cuda_bandwidth_path }}"
6+
owner: "{{ ansible_user }}"
7+
group: "{{ ansible_user }}"
8+
mode: "0755"
9+
10+
- name: Download CUDA bandwith test release
11+
ansible.builtin.unarchive:
12+
remote_src: true
13+
src: "{{ cuda_bandwidth_release_url }}"
14+
dest: "{{ cuda_bandwidth_path }}"
15+
owner: "{{ ansible_user }}"
16+
group: "{{ ansible_user }}"
17+
creates: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8"
18+
19+
- name: Creates CUDA bandwidth test build directory
20+
ansible.builtin.file:
21+
state: directory
22+
path: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build"
23+
mode: "0755"
24+
25+
- name: Ensure cudatests directory exists
26+
ansible.builtin.file:
27+
path: "{{ appliances_environment_root }}/cudatests"
28+
state: directory
29+
mode: '0755'
30+
delegate_to: localhost
31+
32+
- name: Build CUDA bandwidth test
33+
ansible.builtin.shell:
34+
cmd: |
35+
source /cvmfs/software.eessi.io/versions/2023.06/init/bash &&
36+
module load Boost/1.82.0-GCC-12.3.0 &&
37+
. /etc/profile.d/sh.local && cmake .. &&
38+
make -j {{ ansible_processor_vcpus }}
39+
chdir: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build"
40+
creates: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build/nvbandwidth"
41+
42+
- name: Run CUDA bandwidth test
43+
ansible.builtin.shell: |
44+
export LD_LIBRARY_PATH=/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen4/software/GCCcore/12.3.0/lib64:\
45+
/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen4/software/Boost/1.82.0-GCC-12.3.0/lib
46+
./nvbandwidth
47+
args:
48+
chdir: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build/"
49+
register: cuda_bandwidth_output
50+
51+
- name: Save CUDA bandwidth output to bandwidth_results.txt
52+
ansible.builtin.copy:
53+
content: "{{ cuda_bandwidth_output.stdout }}"
54+
dest: "{{ appliances_environment_root }}/cudatests/bandwidth_results.txt"
55+
mode: '0644'
56+
delegate_to: localhost

0 commit comments

Comments
 (0)