diff --git a/README.md b/README.md index 411ea00..50ddc0c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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" \ @@ -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: