zoriya / Kyoo

A portable and vast media library solution.
https://kyoo.zoriya.dev
GNU General Public License v3.0
1.72k stars 41 forks source link

dGPU hardware acceleration not working in systems with an iGPU #641

Open anhminhpho opened 3 weeks ago

anhminhpho commented 3 weeks ago

Kyoo's version

4.7.0

What happened?

Bonjour :)

In a system with an integrated GPU, Kyoo doesn't seem to have access to the dedicated GPU for hardware accelerated transcoding. Infinite loading screen, no GPU activity and no ffmpeg process running:

dGPU image

iGPU image

Modifying the transcoder-nvidia block in the docker-compose file according to this docker documentation fixes the bug, but I'm not sure if it's the best way to do it in this context.

          devices:
            - capabilities: [gpu]
          devices:
            - driver: nvidia
              device_ids: ['0']
              capabilities: [gpu]

Ubuntu Server 22.04 CPU with iGPU: Ryzen 7 5700G dGPU: Nvidia GTX 1080

zoriya commented 3 weeks ago

docker is evolving its API to handle GPU hardware acceleration, I've also seen the following used:

transcoder-nvidia:
    <<: *transcoder-base
    deploy:
      resources:
        reservations:
          devices:
            - driver: cdi
              device_ids:
                - nvidia.com/gpu=all

I think it depends on the version of the docker runtime. While we are in this transition period, I'll add something in the doc about that.