Skip to content

Commit 2ead482

Browse files
authored
Adds bandwidth.yml playbook for NVIDIA nvbandwidth (#834)
* Adds bandwidth.yml playbook to download, build, and run nvbandwidth. bandwidth.yml is ran via cudatests.yml * Adds bandwidth.yml playbook for NVIDIA nvbandwidth and removes samples.yml tasks from adhoc/cudatest.yml * changing output file name
1 parent e4deac6 commit 2ead482

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

ansible/adhoc/cudatests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
- hosts: cuda
33
become: true
44
gather_facts: true
5-
tags: cuda_samples
5+
tags: cuda_bandwidth
66
tasks:
7-
- ansible.builtin.import_role:
7+
- name: Run CUDA bandwidth tasks
8+
ansible.builtin.import_role:
89
name: cuda
9-
tasks_from: samples.yml
10+
tasks_from: bandwidth.yml

ansible/roles/cuda/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ cuda_samples_programs:
2121
# cuda_devices: # discovered from deviceQuery run
2222
cuda_persistenced_state: started
2323
cuda_install_nvidiafabricmanger: false
24+
# variables for nvbandwidth (for bandwidth.yml tasks run in cudatests.yml)
25+
cuda_bandwidth_version: '0.8'
26+
cuda_bandwidth_path: "/var/lib/{{ ansible_user }}/cuda_bandwidth"
27+
cuda_bandwidth_release_url: "https://github.com/NVIDIA/nvbandwidth/archive/refs/tags/v{{ cuda_bandwidth_version }}.tar.gz"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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-{{ cuda_bandwidth_version }}"
18+
19+
- name: Creates CUDA bandwidth test build directory
20+
ansible.builtin.file:
21+
state: directory
22+
path: "{{ cuda_bandwidth_path }}/nvbandwidth-{{ cuda_bandwidth_version }}/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 buildenv/default-foss-2023b &&
37+
module load Boost/1.82.0-GCC-12.3.0 &&
38+
. /etc/profile.d/sh.local &&
39+
cmake .. &&
40+
make -j {{ ansible_processor_vcpus }}
41+
chdir: "{{ cuda_bandwidth_path }}/nvbandwidth-{{ cuda_bandwidth_version }}/build"
42+
creates: "{{ cuda_bandwidth_path }}/nvbandwidth-{{ cuda_bandwidth_version }}/build/nvbandwidth"
43+
44+
- name: Run CUDA bandwidth test
45+
ansible.builtin.shell: |
46+
./nvbandwidth
47+
args:
48+
chdir: "{{ cuda_bandwidth_path }}/nvbandwidth-{{ cuda_bandwidth_version }}/build/"
49+
register: cuda_bandwidth_output
50+
changed_when: true
51+
52+
- name: Save CUDA bandwidth output to bandwidth_results.txt
53+
ansible.builtin.copy:
54+
content: "{{ cuda_bandwidth_output.stdout }}"
55+
dest: "{{ appliances_environment_root }}/cudatests/nvbandwidth-{{ inventory_hostname }}.txt"
56+
mode: '0644'
57+
delegate_to: localhost

0 commit comments

Comments
 (0)