Skip to content

Commit 454756e

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

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-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: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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: source /cvmfs/software.eessi.io/versions/2023.06/init/bash && module load Boost/1.82.0-GCC-12.3.0 && . /etc/profile.d/sh.local && cmake .. && make -j {{ ansible_processor_vcpus }}
35+
chdir: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build"
36+
creates: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build/nvbandwidth"
37+
38+
- name: Run CUDA bandwidth test
39+
ansible.builtin.shell: |
40+
export LD_LIBRARY_PATH=/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen4/software/GCCcore/12.3.0/lib64:/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen4/software/Boost/1.82.0-GCC-12.3.0/lib
41+
./nvbandwidth
42+
args:
43+
chdir: "{{ cuda_bandwidth_path }}/nvbandwidth-0.8/build/"
44+
register: cuda_bandwidth_output
45+
46+
- name: Save CUDA bandwidth output to bandwidth_results.txt
47+
ansible.builtin.copy:
48+
content: "{{ cuda_bandwidth_output.stdout }}"
49+
dest: "{{ appliances_environment_root }}/cudatests/bandwidth_results.txt"
50+
delegate_to: localhost

0 commit comments

Comments
 (0)