Added sample-run for tensorflow
This commit is contained in:
23
sample-run/tensorflow/roles/cuda/README.md
Normal file
23
sample-run/tensorflow/roles/cuda/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# The `cuda` Role
|
||||
|
||||
The `cuda` role installs the Nvidia CUDA GPU repository and drivers.
|
||||
|
||||
This role may be executed independently by running:
|
||||
|
||||
```bash
|
||||
$ ansible-playbook packages.yml --tags "cuda"
|
||||
```
|
||||
|
||||
On execution, this role installs the following directly to the remote machine's operating system:
|
||||
|
||||
### Apt Repositories (Debian/Ubuntu)
|
||||
|
||||
- Nvidia CUDA
|
||||
|
||||
### Apt GPG Signing Keys (Debian/Ubuntu)
|
||||
|
||||
- cudatools <cudatools@nvidia.com>
|
||||
|
||||
### Operating System Packages (Debian/Ubuntu)
|
||||
|
||||
- cuda v10.x
|
||||
0
sample-run/tensorflow/roles/cuda/defaults/.gitkeep
Normal file
0
sample-run/tensorflow/roles/cuda/defaults/.gitkeep
Normal file
Binary file not shown.
Binary file not shown.
5
sample-run/tensorflow/roles/cuda/handlers/main.yml
Normal file
5
sample-run/tensorflow/roles/cuda/handlers/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
# CUDA Driver Setup
|
||||
- name: reboot the machine
|
||||
reboot:
|
||||
listen: "reboot the machine"
|
||||
0
sample-run/tensorflow/roles/cuda/meta/.gitkeep
Normal file
0
sample-run/tensorflow/roles/cuda/meta/.gitkeep
Normal file
22
sample-run/tensorflow/roles/cuda/tasks/debian.yml
Normal file
22
sample-run/tensorflow/roles/cuda/tasks/debian.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# Cuda Driver Package Installation
|
||||
- name: copy the CUDA repo onto the machine
|
||||
copy:
|
||||
src: "{{ cuda.apt.repo }}"
|
||||
dest: "{{ general.working_dir }}/{{ cuda.apt.repo }}"
|
||||
|
||||
- name: get the CUDA signing key
|
||||
apt_key:
|
||||
state: present
|
||||
url: "{{ cuda.apt.signing_key_url }}"
|
||||
|
||||
- name: add the CUDA repo
|
||||
apt:
|
||||
deb: "{{ general.working_dir }}/{{ cuda.apt.repo }}"
|
||||
state: present
|
||||
|
||||
- name: install the CUDA drivers
|
||||
apt:
|
||||
name: "{{ cuda.apt.package }}"
|
||||
update_cache: yes
|
||||
notify: "reboot the machine"
|
||||
3
sample-run/tensorflow/roles/cuda/tasks/main.yml
Normal file
3
sample-run/tensorflow/roles/cuda/tasks/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- import_tasks: debian.yml
|
||||
when: ansible_facts['os_family']|lower == 'debian' # debian, ubuntu
|
||||
0
sample-run/tensorflow/roles/cuda/templates/.gitkeep
Normal file
0
sample-run/tensorflow/roles/cuda/templates/.gitkeep
Normal file
10
sample-run/tensorflow/roles/cuda/vars/main.yml
Normal file
10
sample-run/tensorflow/roles/cuda/vars/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
cuda:
|
||||
apt:
|
||||
package: cuda=11.* # known good with 10.0.130-1
|
||||
repo: cuda-11-3_11.3.1-1_amd64.deb # Network install
|
||||
dependency: cuda-runtime-11-3_11.3.1-1_amd64.deb
|
||||
signing_key_url: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
|
||||
|
||||
general:
|
||||
working_dir: /tmp
|
||||
Reference in New Issue
Block a user