Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU support for plex docker #89

Open
wibuf opened this issue Sep 8, 2019 · 13 comments
Open

GPU support for plex docker #89

wibuf opened this issue Sep 8, 2019 · 13 comments

Comments

@wibuf
Copy link

wibuf commented Sep 8, 2019

Is Nvidia GPU support possible to add to the plex docker?

Thanks

@tom472
Copy link
Owner

tom472 commented Sep 9, 2019

Hey @wibuf

There is actually a pull request in for this via: #73
The issue is if you do not have a DRI device available but the PLEX section of the yaml file is looking to map it then the container fails to start.

I am trying to work out a way to see if the user has a device available or not and only add the mapping for it in the yaml file if it is available.

So it is being looked into I just haven't found the 'right' way to do it yet.

@wibuf
Copy link
Author

wibuf commented Sep 9, 2019

Okay, since I know I have a device available, is there a way to edit the plex docker to use it now instead of waiting for the device check code to be done? Thanks

@tom472
Copy link
Owner

tom472 commented Sep 9, 2019

You will need to edit the docker-compose.yml file and add this to the PLEX section:

devices:
- '/dev/dri:/dev/dri'

The spacing is very important, it should look like what is shown here after adding it in:
https://github.com/tom472/mediabox/pull/73/files

@wibuf
Copy link
Author

wibuf commented Sep 9, 2019

Where's that file located? I've been trying to make changes in portainer itself.

@tom472
Copy link
Owner

tom472 commented Sep 9, 2019

That file should be right inside the mediabox folder.
If you need to know exactly where that folder is you can open the Mediabox landing page on your Mediabox PC, click on the Mediabox icon and scroll down to the "Troubleshooting" section.
To locate where your mediabox folder is look at the value of: PWD in that section.

@wibuf
Copy link
Author

wibuf commented Sep 18, 2019

Does this change require a full restart or just the plex docker? I still can't get the GPU to transcode with plex, but I got it working fine with emby

Here's my docker-compose.yml, I copied and pasted right from the link you posted: https://i.imgur.com/dZD8qSo.png

@tom472
Copy link
Owner

tom472 commented Sep 20, 2019

@wibuf I'll have to get back to you on this... but I'm going to be away for a bit so it will have to wait until I get back.

--Tom

@wibuf
Copy link
Author

wibuf commented Sep 30, 2019

Still working on this. Think I'm a bit closer. I tried running nvidia-smi -L in the plex container console and get the error:
bash: nvidia-smi: command not found

Led me to here: NVIDIA/nvidia-docker#341

I think I'm missing something in the docker-compose
Need to figure out how to add the devices

Should I try using docker-nvidia?
https://www.funkypenguin.co.nz/note/gpu-transcoding-with-emby-plex-using-docker-nvidia/
https://github.com/NVIDIA/nvidia-docker

@wibuf wibuf closed this as completed Sep 30, 2019
@wibuf wibuf reopened this Sep 30, 2019
@tom472
Copy link
Owner

tom472 commented Oct 1, 2019

You should not need nvidia-docker -
What to you get if you do $ ls -lah from the /dev/dri folder on your host PC?

@wibuf
Copy link
Author

wibuf commented Oct 1, 2019

/dev/dri$ ls -lah
total 0
drwxrwxrwx 3 root root 120 Sep 9 00:20 .
drwxr-xr-x 19 root root 4.1K Sep 9 00:20 ..
drwxrwxrwx 2 root root 100 Sep 9 00:20 by-path
crwxrwxrwx 1 root video 226, 0 Sep 9 00:20 card0
crwxrwxrwx 1 root video 226, 1 Sep 9 00:20 card1
crwxrwxrwx 1 root video 226, 128 Sep 9 00:20 renderD128

@jam3srox
Copy link

Im having issues getting HW transcoding working in Plex it just continues to do CPU transcoding. I've added the device to the docker-compose.yml file exactly as suggested.

        hostname: ${HOSTNAME}
        devices:
            - '/dev/dri:/dev/dri'
        volumes:
            - './plex:/config'

My /dev/dri directory is the exact same as above minus card1.

root@media:/dev/dri# ls -lah
total 0
drwxr-xr-x  3 root root       100 Dec 19 16:09 .
drwxr-xr-x 19 root root      4.2K Dec 19 16:13 ..
drwxr-xr-x  2 root root        80 Dec 19 16:09 by-path
crw-rw----  1 root video 226,   0 Dec 19 16:09 card0
crw-rw----  1 root video 226, 128 Dec 19 16:09 renderD128

The drivers are installed for the card and it looks to be working.

media@media:~/mediabox$ nvidia-smi -L
GPU 0: GeForce GTX 1650 SUPER (UUID: GPU-b2d3cb0a-8261-1ac3-88fd-ccb00cba11fe)
media@media:~/mediabox$ nvidia-smi
Thu Dec 19 19:00:04 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.44       Driver Version: 440.44       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 165...  Off  | 00000000:25:00.0 Off |                  N/A |
| 32%   30C    P0    13W / 100W |      0MiB /  3909MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Any help or suggestions would be appreciated.

@wibuf
Copy link
Author

wibuf commented Dec 19, 2019

I went through the same and never was able to get it working.

@wibuf
Copy link
Author

wibuf commented Jun 14, 2020

Been doing more research on this. Looks like its an issue between Nvidia-container-toolkit, Docker 19.03+ and Portainer: portainer/portainer#3143

Won't have a fix for awhile: Not scheduled for development until later this year (post July).

I have not been able to get any workarounds to work successfully. Would probably need to abandon portainer for the plex docker, and use docker2 to get it working successfully.

This should work:
docker run
-d
--name plex
--network=pub_net
--ip=192.168.1.25
--gpus all
-e TZ=
-e PLEX_CLAIM=""
-e NVIDIA_VISIBLE_DEVICES="all"
-e NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
-h
-v /local1/plex/plexdata:/config
-v /local1/plex/transcode:/transcode
-v /mnt/media:/data
--device /dev/dri:/dev/dri
plexinc/pms-docker:plexpass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants