aboutsummaryrefslogtreecommitdiffstats
path: root/docker/nvidia-docker-toolkit
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-06-23 15:04:54 +0000
committerterminaldweller <thabogre@gmail.com>2022-06-23 15:04:54 +0000
commit05c365a54dd074872a6c46f7bd0c6680f7588f71 (patch)
treed896ea101de423427be13cad55418e793c9d03ee /docker/nvidia-docker-toolkit
parentcointop (diff)
downloadscripts-05c365a54dd074872a6c46f7bd0c6680f7588f71.tar.gz
scripts-05c365a54dd074872a6c46f7bd0c6680f7588f71.zip
updates
Diffstat (limited to 'docker/nvidia-docker-toolkit')
-rwxr-xr-xdocker/nvidia-docker-toolkit/build_libnvidia_container.sh9
-rw-r--r--docker/nvidia-docker-toolkit/config.toml34
-rwxr-xr-xdocker/nvidia-docker-toolkit/oci-nvidia-hook2
-rw-r--r--docker/nvidia-docker-toolkit/oci-nvidia-hook.json6
4 files changed, 51 insertions, 0 deletions
diff --git a/docker/nvidia-docker-toolkit/build_libnvidia_container.sh b/docker/nvidia-docker-toolkit/build_libnvidia_container.sh
new file mode 100755
index 0000000..100caaf
--- /dev/null
+++ b/docker/nvidia-docker-toolkit/build_libnvidia_container.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+TOOLKIT_DIR=/home/devi/devi/nvidia-docker/container-toolkit/tools/container/toolkit
+TOOLKIT=${TOOLKIT_DIR}/toolkit
+torsocks make CFLAGS="-I/usr/include/tirpc -fPIC -O2" LDFLAGS=-ltirpc all
+ln -s libnvidia-container.so.1.10.0 libnvidia-container.so.1
+sudo cp libnvidia-container.so.1.10.0 /usr/lib64
+sudo ${TOOLKIT} install /home/devi/nvidia-docker-toolkit
+# nvidia-container-cli
diff --git a/docker/nvidia-docker-toolkit/config.toml b/docker/nvidia-docker-toolkit/config.toml
new file mode 100644
index 0000000..a782015
--- /dev/null
+++ b/docker/nvidia-docker-toolkit/config.toml
@@ -0,0 +1,34 @@
+disable-require = false
+swarm-resource = "DOCKER_RESOURCE_GPU"
+accept-nvidia-visible-devices-envvar-when-unprivileged = true
+accept-nvidia-visible-devices-as-volume-mounts = true
+
+[nvidia-container-cli]
+#root = "/home/devi/nvidia-docker-toolkit"
+#path = "/home/devi/nvidia-docker-toolkit/nvidia-container-cli"
+environment = []
+debug = "/var/log/nvidia-container-toolkit.log"
+#ldcache = "/etc/ld.so.cache"
+load-kmods = true
+no-cgroups = false
+#user = "root:video"
+#ldconfig = "@/sbin/ldconfig.real"
+
+[nvidia-container-runtime]
+#debug = "/var/log/nvidia-container-runtime.log"
+log-level = "info"
+
+# Specify the runtimes to consider. This list is processed in order and the PATH
+# searched for matching executables unless the entry is an absolute path.
+runtimes = [
+ "docker-runc",
+ "runc",
+ "runsc",
+ "nvidia",
+]
+
+mode = "auto"
+
+ [nvidia-container-runtime.modes.csv]
+
+ mount-spec-path = "/etc/nvidia-container-runtime/host-files-for-container.d"
diff --git a/docker/nvidia-docker-toolkit/oci-nvidia-hook b/docker/nvidia-docker-toolkit/oci-nvidia-hook
new file mode 100755
index 0000000..85b4719
--- /dev/null
+++ b/docker/nvidia-docker-toolkit/oci-nvidia-hook
@@ -0,0 +1,2 @@
+#!/bin/sh
+PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/devi/nvidia-docker-toolkit" exec nvidia-container-toolkit "$@"
diff --git a/docker/nvidia-docker-toolkit/oci-nvidia-hook.json b/docker/nvidia-docker-toolkit/oci-nvidia-hook.json
new file mode 100644
index 0000000..fb78494
--- /dev/null
+++ b/docker/nvidia-docker-toolkit/oci-nvidia-hook.json
@@ -0,0 +1,6 @@
+{"version":"1.0.0",
+ "hook":{"path":"nvidia-container-toolkit",
+ "args":["nvidia-container-toolkit","prestart"],
+ "env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/devi/nvidia-docker-toolkit"]},
+ "when":{"always":true,"commands":[".*"]},
+ "stages":["prestart"]}