|
1 |
| -- name: Read cuda version file |
| 1 | +- name: Read CUDA version file |
2 | 2 | slurp:
|
3 | 3 | src: /usr/local/cuda/version.json
|
4 | 4 | register: _cuda_samples_version
|
5 | 5 |
|
6 |
| -- name: Set fact for discovered cuda version |
| 6 | +- name: Set fact for discovered CUDA version |
7 | 7 | set_fact:
|
8 | 8 | _cuda_version_tuple: "{{ (_cuda_samples_version.content | b64decode | from_json).cuda.version | split('.') }}" # e.g. '12.1.0'
|
9 | 9 |
|
|
14 | 14 | owner: "{{ ansible_user }}"
|
15 | 15 | group: "{{ ansible_user }}"
|
16 | 16 |
|
17 |
| -- name: Download cuda sample release |
| 17 | +- name: Download CUDA samples release |
18 | 18 | unarchive:
|
19 | 19 | remote_src: yes
|
20 | 20 | src: "{{ cuda_samples_release_url }}"
|
21 | 21 | dest: "{{ cuda_samples_path }}"
|
22 | 22 | owner: "{{ ansible_user }}"
|
23 | 23 | group: "{{ ansible_user }}"
|
24 | 24 |
|
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 |
26 | 31 | 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" |
31 | 34 |
|
32 |
| -- name: Run cuda deviceQuery |
| 35 | +- name: Run CUDA deviceQuery |
33 | 36 | 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" |
35 | 38 | register: _cuda_devicequery
|
36 | 39 |
|
37 |
| -- name: Set fact for cuda devices |
| 40 | +- name: Set fact for CUDA devices |
38 | 41 | set_fact:
|
39 | 42 | cuda_devices: "{{ _cuda_devicequery.stdout | regex_findall('Device (\\d+):') }}"
|
40 | 43 |
|
41 |
| -- name: Run cuda bandwidth test |
| 44 | +- name: Run CUDA bandwidth test |
42 | 45 | 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 }}" |
44 | 47 | register: _cuda_bandwidthtest
|
45 | 48 | loop: "{{ cuda_devices }}"
|
46 | 49 | loop_control:
|
|
0 commit comments