Jump to content
Codeh

Docker VAAPI with Quadro P2000 Error

Recommended Posts

Codeh

Hello,

 

I'm having difficulty getting hardware transcoding working.

 

Docker /dev/dri

/ # ls -l /dev/dri
total 0
crwxrwxrwx    1 root     44        226, 128 Oct 13 14:11 renderD128

Host /dev/dri

> ls -l /dev/dri
total 0
drwxr-xr-x  2 root root       120 Oct  1 18:01 ./
drwxr-xr-x 18 root root      3.7K Oct 13 10:22 ../
crw-rw----  1 root video 226,   0 Oct  1 18:01 card0
crw-rw----  1 root video 226,   1 Oct  1 18:01 card1
crw-rw----  1 root video 226,  64 Oct  1 18:01 controlD64
crw-rw----  1 root video 226, 128 Oct  1 18:01 renderD128

guid of video is 44.

 

Hardware acceleration is set to: Video Acceleration API (VA API)

VA API Device is set to: /dev/dri/renderD128

 

Full ffmpeg log is attached.

 

Log error:

[AVHWDeviceContext @ 0x2185940] libva: va_getDriverName() failed with unknown libva error,driver_name=(null)
[AVHWDeviceContext @ 0x2185940] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Input/output error


Error parsing global options: Input/output error

Host video cards:

> lshw -numeric -C display
  *-display
       description: VGA compatible controller
       product: MGA G200eW WPCM450 [102B:532]
       vendor: Matrox Electronics Systems Ltd. [102B]
       physical id: 1
       bus info: pci@0000:08:01.0
       version: 0a
       width: 32 bits
       clock: 33MHz
       capabilities: pm vga_controller bus_master cap_list rom
       configuration: driver=mgag200 latency=64 maxlatency=32 mingnt=16
       resources: irq:16 memory:dd000000-ddffffff memory:df000000-df003fff memory:de800000-deffffff memory:c0000-dffff
  *-display
       description: VGA compatible controller
       product: GP106GL [10DE:1C30]
       vendor: NVIDIA Corporation [10DE]
       physical id: 0
       bus info: pci@0000:83:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:77 memory:fa000000-faffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:d000(size=128) memory:fb000000-fb07ffff

Any and all suggestions are welcome!

Share this post


Link to post
Share on other sites
Luke

Hi, have you added emby to the video group?

Share this post


Link to post
Share on other sites
Codeh

Luke, thank you for your reply.

 

I believe I have that set, though I may have done it incorrectly. I have also restarted the container after making these changes.

 

Host user:

> id serviceworker
uid=1001(serviceworker) gid=1001(serviceworker) groups=1001(serviceworker),44(video)

Processes inside container:

/ # ps -ef | grep Emby
  198 1001      0:38 /system/EmbyServer -programdata /config -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3

Share this post


Link to post
Share on other sites
mastrmind11

the question is do you really need it?  in my experience, hardware acc is hit or miss, and 99% of the time not worth the effort.

Share this post


Link to post
Share on other sites
Codeh

mastermind11, I don't need it, but I purchased the card specifically for use with Emby.

 

I accept that hardware transcoding might not work all of the time, but it would be nice to have the option working.

Share this post


Link to post
Share on other sites
Luke

Can you please attach a complete ffmpeg log example? thanks.

Share this post


Link to post
Share on other sites
Codeh

Thought I had it attached in the first post, my mistake. Logfile is attached now.

 

edit: looks like the basic attachment uploader doesn't work. Attached now using the flash uploader.

emby_ffmpeg.txt

Edited by Codeh

Share this post


Link to post
Share on other sites
mastrmind11

Silly question, but did you enable it in your docker run command?

Share this post


Link to post
Share on other sites
Codeh

my docker-compose is as follows. Do I need to add anything in order to enable it?

    emby:
        container_name: emby
        image: emby/embyserver:latest
        restart: always
        ports:
            - "9012:8096"
        volumes:
            - /usr/appdata/emby/config:/config
            - /mnt/virtual/movie:/media/movie
            - /mnt/virtual/tv:/media/tv
            - /usr/letsencrypt/config/etc/letsencrypt:/le-ssl
            - /tmp:/tmp
        devices:
            - /dev/dri/renderD128:/dev/dri/renderD128
            - /dev/nvidia0:/dev/nvidia0
            - /dev/nvidiactl:/dev/nvidiactl
        environment:
            - TZ=America/New_York
            - GID=1001
            - UID=1001
            - GIDLIST=44  

Share this post


Link to post
Share on other sites
dyslexicjedi

I have the exact same problem, down to the same error messages with the same card. Let me know if you find a solution.

Share this post


Link to post
Share on other sites
Luke

@@Codeh did you find a solution?

Share this post


Link to post
Share on other sites
Codeh

I never got it working. I have a feeling that it's a driver issue.

 

I would do more testing but I took my GPU out and won't be back to my server for a few days.

 

Which driver are you using? I think I was using the official Nvidia one

Share this post


Link to post
Share on other sites
Andy777

There has never been any implementation of vaapi for Nvidia hardware.

 

Vaapi is currently Intel (and very limited AMD) only.

 

See ffnpeg hwaccell intro documentation. Use Cuvid/nvdec/nvenc for Nvidia hw.

 

You are "trying to pump gasoline into a Tesla electric car".

Share this post


Link to post
Share on other sites
Codeh

That makes a lot of sense. Guess I need to figure out how to get nvidia hardware acceleration inside of the docker container.

Share this post


Link to post
Share on other sites
dyslexicjedi

@@Andy777 is only slightly right, Nvidia has vdpau which uses the vaapi backend. So vaapi hw accelerated transcode still works with nvidia gpu's. I know this because I have plex side by side Emby and plex is able to vaapi hw transcode to my P2000 with no problem. Verified by process and load using nvidia-smi.

Share this post


Link to post
Share on other sites
dyslexicjedi

Just to expand, I've got both Emby and Plex on the same system with the same vaapi config with the same P2000 card. Basically all variables are identical, so the issue must be in Emby's handling of the interface or something similar, since Plex does work.

Share this post


Link to post
Share on other sites
Andy777

I'd be happy to take a look at the Plex transcoder source if you can point me to it.

 

Maybe they are using the old (updated most recently in 2015) vdpau-libva wrapper which is abandoned.

 

AFAIK the Plex transcoder is based on ffnpeg so the source must be available by definition.

 

I might take the time to install linux to the computers that I have with Quadro p2000.

Share this post


Link to post
Share on other sites
Luke

It would be helpful to test our native package because that would help us isolate whether the problem is docker specific or not. thanks.

Share this post


Link to post
Share on other sites
Andy777

@@Andy777 According to https://github.com/Diagonactic/plex-new-transcoder they have the ffmpeg source listed in their LICENSE file. the LICENSE file has http://downloads.plex.tv/ffmpeg-source/ffmpeg-2018-03-22.tar.gz listed as the most recent ffmpeg source.

 

I rest my case.

See the dates and the issue that this is a (old) copy request by third party.

Edited by Andy777

Share this post


Link to post
Share on other sites
Codeh

@@Andy777, I'm not sure what you mean by your last post.

 

@@Luke, I just tried testing VA-API using `vainfo` and received the output:

> vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
vaInitialize failed with error code -1 (unknown libva error),exit

From this it doesn't look like the P2000 supports VA-API at all. Is there a way to install the required nvidia drivers within the docker container?

 

 

Share this post


Link to post
Share on other sites
softworkz

@@Codeh @@dyslexicjedi @@Andy777

 

I've added you all to the conversation about testing hardware detection on Linux including Docker.

Please read through there, run the tests and then we can see what needs to be addressed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...