Skip to content

Commit

Permalink
Add nvidia gpu config info
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensa committed Nov 13, 2019
1 parent c47d063 commit b2753f9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
#
# Install software and needed libraries
&& apt-get -y install libglib2.0-bin pulseaudio-utils cups-client x11-utils \
&& apt-get -y install module-init-tools libglib2.0-bin pulseaudio-utils cups-client x11-utils \
#
# Assign audio group to non-root user
&& usermod -a -G audio ${USER_NAME} \
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ prepare_docker_webcam_host_sharing() {
prepare_docker_gpu_host_sharing() {
# GPU support (Direct Rendering Manager)
# Only available if non propietry drivers used
[ -d /dev/dri ] && DEVICES+=" --device /dev/dri"
}
Expand Down Expand Up @@ -132,6 +131,25 @@ 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.

## Setup GPU

To make an Nvidia GPU available in the docker container, the following steps have to be taken:

On the host, check your driver version:

# you might have to install this package:
$ sudo apt-get install mesa-utils
$ glxinfo |grep "OpenGL version"
OpenGL version string: 4.6.0 NVIDIA 390.129

In this example, the driver version is "390.129". Now, you have install exactly the same driver in the container:

export VERSION=390.129
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/$VERSION/NVIDIA-Linux-x86_64-$VERSION.run
chmod +x NVIDIA-Linux-x86_64-$VERSION.run
apt-get install -y module-init-tools
./NVIDIA-Linux-x86_64-$VERSION.run -a -N --ui=none --no-kernel-module

## Connect

You can connect to the running container like this:
Expand Down
1 change: 0 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ prepare_docker_webcam_host_sharing() {

prepare_docker_gpu_host_sharing() {
# GPU support (Direct Rendering Manager)
# Only available if non propietry drivers used
[ -d /dev/dri ] && DEVICES+=" --device /dev/dri"
}

Expand Down

0 comments on commit b2753f9

Please sign in to comment.