Added sample-run for tensorflow

This commit is contained in:
Benjamin Jacob Reji
2021-05-22 16:19:41 +04:00
parent 616f161c36
commit 93e7314289
53 changed files with 891 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
# The `nvidia` Role
The `nvidia` role installs the Nvidia Docker runtime, enabling access to Nvidia CUDA GPU hardware from within Docker containers.
This role may be executed independently by running:
```bash
$ ansible-playbook packages.yml --tags "nvidia"
```
On execution, this role installs the following directly to the remote machine's operating system:
### Apt Repositories (Debian/Ubuntu)
- libnvidia_container
- nvidia_container_runtime
- nvidia_docker
### Apt GPG Signing Keys (Debian/Ubuntu)
- NVIDIA CORPORATION (Open Source Projects) <cudatools@nvidia.com>
### Operating System Packages (Debian/Ubuntu)
- nvidia-docker2 v2.x
Containers are launched with the Nvidia Docker runtime by passing the `--runtime=nvidia` flag, e.g.,
```bash
$ docker run --rm --runtime=nvidia nvidia/cuda nvidia-smi
```

View File

@@ -0,0 +1,6 @@
---
- name: reload the docker service
systemd:
name: docker
state: reloaded
listen: "reload the docker service"

View File

@@ -0,0 +1,31 @@
---
# Nvidia Docker Runtime Installation
- name: get the NVIDIA signing key
apt_key:
state: present
url: "{{ nvidia.apt.signing_key_url }}"
- name: add the libnvidia-container repo
apt_repository:
filename: "{{ nvidia.apt.repo_filename }}"
repo: "{{ nvidia.apt.repos.libnvidia_container }}"
state: present
- name: add the nvidia-container-runtime repo
apt_repository:
filename: "{{ nvidia.apt.repo_filename }}"
repo: "{{ nvidia.apt.repos.nvidia_container_runtime }}"
state: present
- name: add the nvidia-docker repo
apt_repository:
filename: "{{ nvidia.apt.repo_filename }}"
repo: "{{ nvidia.apt.repos.nvidia_docker }}"
state: present
- name: install the nvidia-docker2 runtime
apt:
name: "{{ nvidia.apt.package }}"
state: present
update_cache: yes
notify: "reload the docker service"

View File

@@ -0,0 +1,4 @@
---
# Nvidia Docker Runtime Setup
- import_tasks: debian.yml
when: ansible_facts['os_family']|lower == 'debian' # debian, ubuntu

View File

@@ -0,0 +1,10 @@
---
nvidia:
apt:
package: nvidia-docker2=2.* # known good with 2.0.3+docker18.09.1-1
repo_filename: nvidia_github_io_nvidia_docker_ubuntu18_04_nvidia_docker.list
repos:
libnvidia_container: deb https://nvidia.github.io/libnvidia-container/ubuntu18.04/$(ARCH) /
nvidia_container_runtime: deb https://nvidia.github.io/nvidia-container-runtime/ubuntu18.04/$(ARCH) /
nvidia_docker: deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/$(ARCH) /
signing_key_url: https://nvidia.github.io/nvidia-docker/gpgkey