Skip to content

Commit d0cf2a7

Browse files
committed
Update CUDA samples playbook for CUDA 12.8
1 parent d4b6cb8 commit d0cf2a7

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

ansible/adhoc/cudatests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- hosts: cuda
22
become: yes
3-
gather_facts: no
3+
gather_facts: yes
44
tags: cuda_samples
55
tasks:
66
- import_role:

ansible/roles/cuda/tasks/samples.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
- name: Read cuda version file
1+
- name: Read CUDA version file
22
slurp:
33
src: /usr/local/cuda/version.json
44
register: _cuda_samples_version
55

6-
- name: Set fact for discovered cuda version
6+
- name: Set fact for discovered CUDA version
77
set_fact:
88
_cuda_version_tuple: "{{ (_cuda_samples_version.content | b64decode | from_json).cuda.version | split('.') }}" # e.g. '12.1.0'
99

@@ -14,33 +14,36 @@
1414
owner: "{{ ansible_user }}"
1515
group: "{{ ansible_user }}"
1616

17-
- name: Download cuda sample release
17+
- name: Download CUDA samples release
1818
unarchive:
1919
remote_src: yes
2020
src: "{{ cuda_samples_release_url }}"
2121
dest: "{{ cuda_samples_path }}"
2222
owner: "{{ ansible_user }}"
2323
group: "{{ ansible_user }}"
2424

25-
- name: Build cuda samples
25+
- name: Create CUDA samples build directory
26+
file:
27+
state: directory
28+
path: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/build"
29+
30+
- name: Build CUDA samples
2631
shell:
27-
cmd: make
28-
chdir: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/Samples/1_Utilities/{{ item }}"
29-
creates: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/bin/x86_64/linux/release/{{ item }}"
30-
loop: "{{ cuda_samples_programs }}"
32+
cmd: cmake .. && make -j {{ ansible_processor_vcpus }}
33+
chdir: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/build"
3134

32-
- name: Run cuda deviceQuery
35+
- name: Run CUDA deviceQuery
3336
command:
34-
cmd: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/bin/x86_64/linux/release/deviceQuery"
37+
cmd: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/build/Samples/1_Utilities/deviceQuery/deviceQuery"
3538
register: _cuda_devicequery
3639

37-
- name: Set fact for cuda devices
40+
- name: Set fact for CUDA devices
3841
set_fact:
3942
cuda_devices: "{{ _cuda_devicequery.stdout | regex_findall('Device (\\d+):') }}"
4043

41-
- name: Run cuda bandwidth test
44+
- name: Run CUDA bandwidth test
4245
command:
43-
cmd: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/bin/x86_64/linux/release/bandwidthTest --device={{ item }}"
46+
cmd: "{{ cuda_samples_path }}/cuda-samples-{{ cuda_version_short }}/build/Samples/1_Utilities/bandwidthTest/bandwidthTest --device={{ item }}"
4447
register: _cuda_bandwidthtest
4548
loop: "{{ cuda_devices }}"
4649
loop_control:

0 commit comments

Comments
 (0)