Our forum migration to Discourse is underway and scheduled to last through June 21. During the migration, the forums will be read-only, except for a single temporary forum (contents of which will not be getting transferred). Read our announcement post for more information about the forum migration.
Hey folks, there is a new Podcast category for forums https://forums.plex.tv/categories/podcasts
If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Using hardware acceleration in docker

gravufogravufo Members, Plex Pass Posts: 3 Plex Pass

I'm trying to use hardware acceleration inside my docker container (using wernight/plex-media-server:autoupdate image) and it fails.

I have a AMD HD6950 and an Intel i7-2700k iGPU. I know that plex will not work on the AMD card, but I'd like to use the iGPU.
Note that my motherboard does not have an output for the iGPU.

Here is the output of sudo lshw -c video on the host and inside the container:

*-display
description: VGA compatible controller
product: Cayman PRO [Radeon HD 6950]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0
bus info: pci@0000:04:00.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
configuration: driver=radeon latency=0
resources: irq:50 memory:e0000000-efffffff memory:f7d20000-f7d3ffff ioport:d000(size=256) memory:f7d00000-f7d1ffff
*-display
description: Display controller
product: 2nd Generation Core Processor Family Integrated Graphics Controller
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm bus_master cap_list
configuration: driver=i915 latency=0
resources: irq:53 memory:f7000000-f73fffff memory:d0000000-dfffffff ioport:f000(size=64)

Here is the output of lsmod | grep i915 on the host:

i915 1232896 0
i2c_algo_bit 16384 2 i915,radeon
drm_kms_helper 155648 2 i915,radeon
drm 364544 5 ttm,i915,drm_kms_helper,radeon
video 40960 2 i915,asus_wmi

Here is the output of lspci | grep VGA on the host and inside the container:

04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cayman PRO [Radeon HD 6950]

Inside the container, vainfo gives me the following 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 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/gallium_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

My container has --device=/dev/dri:/dev/dri and I also did a chmod -R 777 /dev/dri (I know it's bad practice, just trying to test things out).

If anyone has any clue, I'd really appreciate some help!

Thanks

Best Answer

  • gravufogravufo Members, Plex Pass Posts: 3 Plex Pass
    Accepted Answer

    I finally managed to make it work by explicitly mapping the correct device, i.e. I mapped the Intel iGPU only (since AMD cards are not supported).

    To do so, simply use --device=/dev/dri/card1:/dev/dri/card0 --device /dev/dri/renderD129:/dev/dri/renderD128
    Of course, adapt the number avec cardX and renderDXYZ to match your system.

Answers

  • gravufogravufo Members, Plex Pass Posts: 3 Plex Pass
    Accepted Answer

    I finally managed to make it work by explicitly mapping the correct device, i.e. I mapped the Intel iGPU only (since AMD cards are not supported).

    To do so, simply use --device=/dev/dri/card1:/dev/dri/card0 --device /dev/dri/renderD129:/dev/dri/renderD128
    Of course, adapt the number avec cardX and renderDXYZ to match your system.

  • aguti76aguti76 Members, Plex Pass Posts: 2 Plex Pass

    Hi. I'm using plex in a docker with a intel j3455 nas server running openmediavault. I can't make hardware acceleration working with this configuration. Before i had plex in OMV plugin and it worked with H.A. I'm a plex pass user of course.
    Thanks

  • aguti76aguti76 Members, Plex Pass Posts: 2 Plex Pass

    I just found this in plex articles
    Can I use Hardware-Accelerated Streaming inside of Docker?
    At this time, we do not formally support hardware acceleration inside of a Docker container. Some users of Docker (on Linux only) have been able to accomplish this by adding platform-specific custom configurations that expose host hardware to the container.

    Somebody knows this openmediavault "platform-specific custom configurations that expose host hardware to the container"?

Sign In or Register to comment.