Plex finds my gpu but cant use it for transcoding on Debian 10

Server Version#: 1.19.4.2865
Player Version#: browser

Im having a hard time figuring out why hardware transcoding doesnt work for me. It seems like the installer finds my graphic card just fine. Ive even checked that the plex user is part of the render group.

My initial idea was to run plex in docker but i had the same issue here so i thought i would dial back and try to get it running natively first.

If anyone could point me to a thing i should checkout, that would be much appreciated! Thanks

Processor: AMD Ryzen 3600
Motherboard: ASRock Fatal1ty B450 Gaming-ITX

$ uname -a
Linux sparky 5.4.0-0.bpo.4-amd64 #1 SMP Debian 5.4.19-1~bpo10+1 (2020-03-09) x86_64 GNU/Linux


$ nvidia-smi
Sun May 31 14:50:31 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       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  Quadro P2200        On   | 00000000:0A:00.0  On |                  N/A |
| 48%   40C    P0    21W /  75W |     12MiB /  5044MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

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


$ sudo dpkg -i plexmediaserver_1.19.4.2865-4fa317f77_amd64.deb
Selecting previously unselected package plexmediaserver.
(Reading database ... 97398 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.19.4.2865-4fa317f77_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.19.4.2865-4fa317f77) ...
Setting up plexmediaserver (1.19.4.2865-4fa317f77) ...
PlexMediaServer install: PlexMediaServer-1.19.4.2865-4fa317f77 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   Update
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         render
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /var/lib/plexmediaserver/Transcoding  (set in Preferences.xml)
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Transcoding HW:      Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.19.4.2865-4fa317f77 - Installation successful.  Errors: 0, Warnings: 0
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for mime-support (3.62) ...


$ id plex
uid=998(plex) gid=997(plex) groups=997(plex),44(video),107(render)


$ ls -la /dev/dri/
total 0
drwxr-xr-x   3 root root        100 May 31 13:02 .
drwxr-xr-x  19 root root       3520 May 31 13:03 ..
drwxr-xr-x   2 root root         80 May 31 13:02 by-path
crw-rw----+  1 root video  226,   0 May 31 14:45 card0
crw-rw----+  1 root render 226, 128 May 31 14:45 renderD128


# in the log file
May 31, 2020 14:48:43.026 [0x7f4fa5ffb700] DEBUG - Job running: EAE_ROOT='/tmp/pms-7e052735-77d1-4f67-b29c-f3a035942492/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/99c90e0-3095-linux-x86_64/' XDG_CACHE_HOME='/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/usr/lib/plexmediaserver/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:#0x01' 'h264' '-codec:#0x02' 'mp3' '-ss' '0' '-noaccurate_seek' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/home/christian/media/bbb_sunflower_2160p_60fps_normal.mp4' '-filter_complex' '[0:#0x02] aresample=async=1:ocl='\''stereo'\'':osr=48000[0]' '-map' '0:#0x01' '-codec:0' 'copy' '-map' '[0]' '-codec:1' 'aac' '-b:1' '256k' '-f' 'dash' '-seg_duration' '5' '-init_seg_name' 'init-stream$RepresentationID$.m4s' '-media_seg_name' 'chunk-stream$RepresentationID$-$Number%05d$.m4s' '-window_size' '5' '-delete_removed' 'false' '-skip_to_segment' '1' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/drk1cn3euckj3nhyhhaar9yv/a18edef7-cbf3-40fc-862b-372c4a803346/manifest?X-Plex-Http-Pipeline=infinite' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/drk1cn3euckj3nhyhhaar9yv/a18edef7-cbf3-40fc-862b-372c4a803346/progress'
May 31, 2020 14:48:45.436 [0x7f4f5affd700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error

Plex Media Server Logs_2020-05-31_15-06-16.zip (425.8 KB)

Does the card support the specific video codec?

Prior to starting the session, the transcoder attempts a test frame which matches the pending task.

This small block shows how the transcoder probes the CPU for QSV support. Since the Ryzen doesn’t have that, the test fails. This is a normal result.

May 31, 2020 14:48:43.059 [0x7f4fc9c60700] DEBUG - Auth: authenticated user 1 as ranza
May 31, 2020 14:48:43.059 [0x7f4f39ffb700] DEBUG - Request: [10.0.0.50:49863 (Subnet)] GET /status/sessions (18 live) TLS GZIP Signed-in Token (ranza)
May 31, 2020 14:48:43.059 [0x7f4f39ffb700] DEBUG - [Now] Adding 1 sessions.
May 31, 2020 14:48:43.060 [0x7f4fc9c60700] DEBUG - Completed: [10.0.0.50:49863] 200 GET /status/sessions (18 live) TLS GZIP 0ms 2301 bytes (pipelined: 17)
May 31, 2020 14:48:43.103 [0x7f4f5affd700] DEBUG - Codecs: testing h264 (decoder) with hwdevice vaapi
May 31, 2020 14:48:43.103 [0x7f4f5affd700] DEBUG - Codecs: hardware transcoding: testing API vaapi
May 31, 2020 14:48:43.103 [0x7f4f5affd700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
May 31, 2020 14:48:43.103 [0x7f4f5affd700] DEBUG - Codecs: testing h264 (decoder) with hwdevice nvdec
May 31, 2020 14:48:43.103 [0x7f4f5affd700] DEBUG - Codecs: hardware transcoding: testing API nvdec
May 31, 2020 14:48:43.103 [0x7f4f5affd700] DEBUG - [FFMPEG] - Loaded lib: libcuda.so.1

I would think the Quadro P2200 have h264 support. But i might be wrong?

I just did a test from my phone (i dont know why i didnt think of that before) but it actually showed up as hardware transcoding.

But when doing the same in the chrome i get this which will result in a stall when it reach the end of the buffer

Heres a new log with which should include the new output

Plex Media Server Logs_2020-05-31_16-08-25.zip (1.1 MB)

This is the videofile in testing with

Ooh i see what you’re saying. So the “error” isnt really an error. Its just telling me that my CPU doesnt support QSV, and then continues to test for nvdec, which it have and loads the libs for ffmpeg.

Oh god, i think you might be right on the codec thing. Maybe my file was faulty. I just tested with a different file and codec and it transcodes perfectly!

Screenshot 2020-05-31 at 16.26.47

Still wondering if it might be a bug that it didnt default back to CPU when GPU fails on the h264 file? The file im using is this: http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_2160p_60fps_normal.mp4

So investigating a bit further on what happened… I tried playing the same file as before but from a remote address. Then asked plex to convert the file and then hardware transcoding was triggered. It would seem that plex sees that im on the same network as server and thinks it should serve me the direct stream instead of transcoding the file, even though i specifically ask it to convert the file to a lower bitrate.

Whats even more weird is that this seems to only happen for h264 codecs. So what i thought was that nvdec wasnt working. But from what i can see it should be.
I found the nvdec patch on github (GitHub - revr3nd/plex-nvdec) but i havent given it a try and since it seem to work remotely i feel like it should work locally too.

This seems like a bug but im not sure how to test this. Id be happy to help if you want me to test things :slight_smile:

Go to the Player.
In its settings

Set the bitrate to some low value.

Now play the file

Observe the results

Thats exactly what i did… HW transcoding triggers when im on a remote address but not locally.

DEBUG log files please which capture this happening.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.