Skip to content

Commit

Permalink
Fixed string names
Browse files Browse the repository at this point in the history
  • Loading branch information
simo-tuomisto committed Apr 7, 2021
1 parent b32cba8 commit ed5890b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tasks/install_runfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
set_fact:
cuda_runfile_sh: "{{ cuda_runfile_url | basename }}"

- name: 'Determine running kernel'
- name: "Determine running kernel"
command: uname -r
register: cuda_driver_kernel_running

- name: 'Determine kernel version'
- name: "Determine kernel version"
set_fact:
cuda_driver_kernel_version: "{{ cuda_driver_kernel_version | default(cuda_driver_kernel_running.stdout, true) }}"

- name: 'Check NVIDIA kernel module'
- name: "Check NVIDIA kernel module"
stat:
path: /lib/modules/{{ cuda_driver_kernel_version }}/video/nvidia.ko
register: cuda_driver_kernel_module
Expand All @@ -41,7 +41,7 @@
path: /usr/local/cuda
register: cuda_toolkit_path

- name: 'Determine if driver and toolkit are installed'
- name: "Determine if driver and toolkit are installed"
set_fact:
cuda_driver_installed: "{{ cuda_driver_kernel_module.stat.exists }}"
cuda_toolkit_installed: "{{ cuda_toolkit_path.stat.exists }}"
Expand Down Expand Up @@ -74,28 +74,28 @@
register: cuda_toolkit_install_out
when: cuda_runfile_toolkit and not cuda_toolkit_installed

- name: 'Install driver'
- name: "Install driver"
block:

- name: 'Extract installer for driver installation'
- name: "Extract installer for driver installation"
command: bash /tmp/cuda_runfile/{{ cuda_runfile_sh }} --extract=/tmp/cuda_runfile

- name: 'Find NVIDIA runtime'
- name: "Find NVIDIA runtime"
find:
paths: /tmp/cuda_runfile
patterns: 'NVIDIA*.run'
patterns: "NVIDIA*.run"
register: cuda_driver_runfile_find

- name: 'Set NVIDIA runfile path'
- name: "Set NVIDIA runfile path"
set_fact:
cuda_driver_runfile: "{{ cuda_driver_runfile_find.files[0].path }}"

- name: 'Print information about driver'
- name: "Print information about driver"
debug:
msg: "Building driver {{ cuda_driver_runfile }} for kernel {{ cuda_driver_kernel_version }}"

- name: 'Install driver'
command: bash {{ cuda_driver_runfile }} --silent --kernel-name={{ cuda_driver_kernel_version }} --kernel-source-path=/usr/src/kernels/{{ cuda_driver_kernel_version }} {{ '--no-drm' if cuda_runfile_disable_nvidia_drm else '' }}
- name: "Install driver"
command: bash {{ cuda_driver_runfile }} --silent --kernel-name={{ cuda_driver_kernel_version }} --kernel-source-path=/usr/src/kernels/{{ cuda_driver_kernel_version }} {{ "--no-drm" if cuda_runfile_disable_nvidia_drm else "" }}

when: cuda_runfile_driver and not cuda_driver_installed

Expand Down

0 comments on commit ed5890b

Please sign in to comment.