Jump to content

HW Acceleration missing


Go to solution Solved by darkassassin07,

Recommended Posts

Posted

Hi guys,

I changed the host for my Emby Docker container, and now hardware acceleration is missing.

Originally, I set up my Emby Docker container via Compose directly on a Proxmox host, with the NVIDIA driver, Docker toolkit, and everything else installed, and it worked perfectly.

For various reasons, I decided to move the Emby service to a VM on the Proxmox host. I configured GPU passthrough to the VM, installed the NVIDIA driver and toolkit on the VM, and transferred all Emby files. However, the UI no longer shows a hardware transcoder.

Running docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi works as expected.

I’m a bit lost since the underlying setup, Compose YAML, and files haven’t changed.

Posted

Hi, sounds like you need to configure the VM to pass it through ?

  • Agree 1
Posted (edited)
12 minutes ago, Skuld said:

I configured GPU passthrough to the VM, installed the NVIDIA driver and toolkit on the VM, and transferred all Emby files

Inside the vm and then inside a container i am able to run "docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi" and it runs like expected. I doubt that this would work if passthrough was not done

Edited by Skuld
Posted

Please, i am poaking in every direction trying to find the cause.

What does emby accesses on linux devices so i can maybe run a testworkload inside the container with a attached console, like /dev/nvidia0 or something.

Posted

I am able to run NVDEC & NVENC inside the vm and while doing so nvidia-smi lists a process

Posted

This is from inside the emby docker container:

ffmpeg -encoders | grep nvenc
ffmpeg version 5.1-emby_2023_06_25_p4 Copyright (c) 2000-2022 the FFmpeg developers and softworkz for Emby LLC
  built with gcc 10.3.0 (crosstool-NG 1.25.0)
Execution Date: 2025-11-20 19:23:38
 V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V....D hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)
EXIT
/ # ffmpeg -hwaccels
ffmpeg version 5.1-emby_2023_06_25_p4 Copyright (c) 2000-2022 the FFmpeg developers and softworkz for Emby LLC
  built with gcc 10.3.0 (crosstool-NG 1.25.0)
Execution Date: 2025-11-20 19:23:46
Hardware acceleration methods:
cuda
vaapi
qsv
drm
opencl

EXIT

Posted

I saw something in the logs and tryed it, this is from inside the container:
/bin/ffdetect -hide_banner -show_program_version -loglevel 48 -show_error -show_log 40 nvencdec -print_format json
ffdetect version 5.1-emby_2023_06_25_p4 Copyright (c) 2018-2022 softworkz for Emby LLC
  built with gcc 10.3.0 (crosstool-NG 1.25.0)
  configuration: --cc=x86_64-emby-linux-gnu-gcc --prefix=/home/embybuilder/Buildbot/x64/ffmpeg-x64/staging --disable-alsa --disable-doc --disable-ffplay --disable-gnutls --disable-libpulse --disable-librtmp --disable-libxcb --disable-openssl --disable-vdpau --disable-vulkan --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gpl --enable-iconv --enable-libaribb24 --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libzvbi --enable-mbedtls --enable-pic --enable-version3 --enable-libtesseract --enable-cuda-llvm --enable-cuvid --enable-libdrm --enable-libmfx --enable-nvdec --enable-nvenc --enable-vaapi --enable-opencl --enable-cross-compile --cross-prefix=x86_64-emby-linux-gnu- --arch=x86_64 --target-os=linux --enable-shared --disable-static --pkg-config=pkg-config --pkg-config-flags=--static --extra-libs='-ldl -lm -lstdc++ -lsharpyuv -pthread' --disable-debug
  libavutil      57. 28.100 / 57. 28.100
{
    "ProgramVersion": {
        "Version": "5.1-emby_2023_06_25_p4",
        "Copyright": "Copyright (c) 2018-2022 softworkz for Emby Llc",
        "Compiler": "gcc 10.3.0 (crosstool-NG 1.25.0)",
        "Configuration": "--cc=x86_64-emby-linux-gnu-gcc --prefix=/home/embybuilder/Buildbot/x64/ffmpeg-x64/staging --disable-alsa --disable-doc --disable-ffplay --disable-gnutls --disable-libpulse --disable-librtmp --disable-libxcb --disable-openssl --disable-vdpau --disable-vulkan --disable-xlib --enable-chromaprint --enable-fontconfig --enable-gpl --enable-iconv --enable-libaribb24 --enable-libass --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libzvbi --enable-mbedtls --enable-pic --enable-version3 --enable-libtesseract --enable-cuda-llvm --enable-cuvid --enable-libdrm --enable-libmfx --enable-nvdec --enable-nvenc --enable-vaapi --enable-opencl --enable-cross-compile --cross-prefix=x86_64-emby-linux-gnu- --arch=x86_64 --target-os=linux --enable-shared --disable-static --pkg-config=pkg-config --pkg-config-flags=--static --extra-libs='-ldl -lm -lstdc++ -lsharpyuv -pthread' --disable-debug"
Cannot load libcuda.so.1
Error loading CUDA functions
    },
    "Error": {
        "Number": -1,
        "Message": "Operation not permitted"
    },
    "Log": [
        {
            "Level": 16,
            "Category": 0,
            "Message": "Cannot load libcuda.so.1"
        },
        {
            "Level": 16,
            "Category": 0,
            "Message": "Error loading CUDA functions"
        }
    ]
}

 

My docker yml is:

version: "2.3"
services:
  emby:
    image: emby/embyserver
    stdin_open: true
    tty: true
    container_name: embyserver
    runtime: nvidia # Expose NVIDIA GPUs
    environment:
      - UID=1000 #1003# The UID to run emby as (default: 2)
      - GID=1000 #100# The GID to run emby as (default 2)
      - GIDLIST=40,992 # A comma-separated list of additional GIDs to run emby as (default: 2)
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
    volumes:
      - /opt/docker/mounted_storage/emby:/config # Configuration directory
      - /mnt/Videos:/mnt/Videos # Media directory
      - /mnt/ZFS1/transcoding-temp:/embytemp
    ports:
      - 8096:8096 # HTTP port
      - 8920:8920 # HTTPS port
    devices:
      - /dev/dri:/dev/dri # VAAPI/NVDEC/NVENC render nodes
    restart: unless-stopped

Posted

Can you try our native package directly on the host machine to see how that compares?

  • Solution
darkassassin07
Posted (edited)

Potentially related. I was getting the same permission error in my logs.

 

 

Edited by darkassassin07
  • Thanks 1
Posted

Legendary hint from @darkassassin07, i did what he did and this solved it.

i also changed version: "2.3" to version: "3.8".

15 hours ago, darkassassin07 said:

Solved!

 

My Emby compose file had:

    runtime: nvidia # Expose NVIDIA GPUs

 

Tdarr on the otherhand used: 

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities:
                - gpu

 

I had tried adding the deploy section to emby, but hadn't removed the runtime arg. Once I properly swapped them out, Embys container saw the gpu in the correct groups and now both Emby and Tdarr are able to use the gpu as expected. (I had also tried stopping Tdarr to see if it was somehow 'reserving' the gpu and preventing Emby from using it, as the term 'reservations' above would imply, but that was not the case)

 

@guunterWhich of the two do you have, or are you using something different?

 

  • Like 1
darkassassin07
Posted

Hmm. That's two of us now. I wonder why the Nvidia runtime no longer seems to work in the official emby container. 

 

When I've got some more free time I'm going to try the linxuserver.io version on my system just to see if it can use the runtime correctly. Not sure if this is the runtime being broken or somehow the implementation within emby is flawed.

 

At least this is workin for now.

Posted

Looks like that we are not the only ones with this problem, all over other forums reports for this issue appear.
But there does not seem to be a official drop of support for the "old" implementation, but since it is depricated anyway it probably makes sense to change it in the setup guide as well.

Posted
35 minutes ago, darkassassin07 said:

Hmm. That's two of us now. I wonder why the Nvidia runtime no longer seems to work in the official emby container. 

 

When I've got some more free time I'm going to try the linxuserver.io version on my system just to see if it can use the runtime correctly. Not sure if this is the runtime being broken or somehow the implementation within emby is flawed.

 

At least this is workin for now.

You should. They do have more tweaks to their image for hw support. I also use them for my other dockers so all my yaml can be consistent.

Posted

Hi, we will look at updating our instructions. Thanks.

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...