From 05c365a54dd074872a6c46f7bd0c6680f7588f71 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Thu, 23 Jun 2022 19:34:54 +0430 Subject: updates --- .../build_libnvidia_container.sh | 9 ++++++ docker/nvidia-docker-toolkit/config.toml | 34 ++++++++++++++++++++++ docker/nvidia-docker-toolkit/oci-nvidia-hook | 2 ++ docker/nvidia-docker-toolkit/oci-nvidia-hook.json | 6 ++++ 4 files changed, 51 insertions(+) create mode 100755 docker/nvidia-docker-toolkit/build_libnvidia_container.sh create mode 100644 docker/nvidia-docker-toolkit/config.toml create mode 100755 docker/nvidia-docker-toolkit/oci-nvidia-hook create mode 100644 docker/nvidia-docker-toolkit/oci-nvidia-hook.json (limited to 'docker') 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"]} -- cgit v1.2.3