Skip to content

Commit

Permalink
Allow nvidia drivers installation on run
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensa committed Dec 12, 2019
1 parent 829cd7a commit a330172
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ prepare_docker_hostname_host_sharing() {
EXTRA+=" --hostname `hostname`"
}
prepare_docker_nvidia_drivers_install() {
# NVidia propietary drivers are needed on host for this to work
if [ `command -v nvidia-smi` ]; then
NVIDIA_VERSION=$(nvidia-smi --query-gpu=driver_version --format=csv,noheader)
# On run, if you specify NVIDIA_VERSION the nvidia specified drivers version are installed
ENV_VARS+=" --env=NVIDIA_VERSION=${NVIDIA_VERSION}"
fi
}
prepare_docker_timezone
prepare_docker_user_and_group
prepare_docker_dbus_host_sharing
Expand All @@ -142,6 +152,7 @@ prepare_docker_gpu_host_sharing
prepare_docker_printer_host_sharing
prepare_docker_x11_host_sharing
prepare_docker_hostname_host_sharing
prepare_docker_nvidia_drivers_install
docker run --rm -it \
--name "ubuntu-tini-x11" \
Expand All @@ -161,6 +172,8 @@ This way, the internal user UID an group GID are changed to the current host use

Functions prepare_docker_dbus_host_sharing, prepare_docker_xdg_runtime_dir_host_sharing, prepare_docker_sound_host_sharing, prepare_docker_webcam_host_sharing, prepare_docker_gpu_host_sharing, prepare_docker_printer_host_sharing, prepare_docker_x11_host_sharing and prepare_docker_hostname_host_sharing allows sharing your host resources with the running container as GUI apps can interact with your host system as they where installed in the host.

Function prepare_docker_nvidia_drivers_install allows the nvidia drivers host version to be installed on container.

## Connect

You can connect to the running container like this:
Expand Down

0 comments on commit a330172

Please sign in to comment.