@ZeRoSyNC, Not sure if you ever figured it out, but I’ve been attempting to do the same thing for the past couple of days and finally managed to! Since this thread came up close to the top when I googled, I figured I’d add my two cents so hopefully it takes the next person less time than it took me to get it working.
I did this on OpenMediaVault 4.0, which is based on Debian 9. I imagine it’s almost exactly the same on other distributions.
Obviously, first install the Linux Nvidia driver for your GPU and make sure it’s working.
Then install nvidia-docker2 (these instructions from https://github.com/NVIDIA/nvidia-docker)
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
Once that is all set up, when you configure the plex docker container, add the environment variables:
NVIDIA_VISIBLE_DEVICES all
NVIDIA_DRIVER_CAPABILITIES compute,video,utility
and add the switch
--runtime=nvidia
to your run/create command, i.e.
docker create \
--runtime=nvidia \
--name=plex \
--net=host \
-e NVIDIA_VISIBLE_DEVICES=all \
-e NVIDIA_DRIVER_CAPABILITIES=compute,video,utility \
-e VERSION=latest \
-e PUID=<UID> -e PGID=<GID> \
-e TZ=<timezone> \
-v </path/to/library>:/config \s
-v <path/to/tvseries>:/data/tvshows \
-v </path/to/movies>:/data/movies \
-v </path for transcoding>:/transcode \
linuxserver/plex
that’s all it took to get my GPU to be enabled in docker!
Surprisingly easy in the end after going down many wrong paths!
EDIT: Added steps to add nvidia-docker repo