Jump to content

Docker HWA Nvidia Instructions


cnstarz

Recommended Posts

quorn23

Feedback for someone, that might looking for it

Tested the posting from karlshea https://emby.media/community/index.php?/topic/76937-docker-hwa-nvidia-instructions/&do=findComment&comment=1148425 on an up to date Debian 11 instance with a 1080TI and the Linuxserver image.

Following the nvidia-container-toolkit installation from the nvidia link and then using the current way, which is still the official way described in the docker docs https://docs.docker.com/compose/gpu-support/

 

Works like a charm, hassle free.

Prior to this i made sure my gpu is working properly with debian 11, following this guide: Install Nvidia Drivers on Debian 11 Bullseye

 

Thanks Karl for the post, mainly writing this reply in case someone with a similar setup is guessing which of the many ways posted here works with Debian 11 today.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
hispeed

@D34DC3N73R and @cypher0117

I have the exact same problem and have spent hours in it.

Have look at: https://gitlab.com/nvidia/container-toolkit/container-toolkit/-/issues/9

How can I install on Debian 11?

  • libnvidia-decode-418-server
  • libnvidia-encode-418-server

I will probably set up an Ubuntu Machine with Docker and set up emby in the container. With that I can 100% confirm this. Yes i'm the first and only one who is using Debian as Docker host and uses HW AC in the world, yeaah!

I already can confirm that emby is working on Debian 11 on a VM and HW AC is working, but inside a Docker i don't see the card same as cypher0117 didn't see it. Nividia-smi works in a container without any problem.

Edited by hispeed
Added more information.
Link to comment
Share on other sites

cypher0117
5 hours ago, hispeed said:

How can I install on Debian 11?

  • libnvidia-decode-418-server
  • libnvidia-encode-418-server

installing those should be simply:

sudo apt install libnvidia-decode-418-server libnvidia-encode-418-server

 

As far as your hw log in Emby, mine still shows that it can't open the DRM device.  After installing the encode/decode libraries and restarting the Emby container I was then able to select options in the emby transcode menu even though the hw log shows drm device issues.  After selecting options in the emby transcode menu, the emby container will hw transcode when needed, again even though there are errors in the hw log.

Link to comment
Share on other sites

hispeed

@cypher0117

Ok if it's only a log entry that would be fine for me.

Unfortunately when i try to install with your command the packages it tells me that they are not available.

I use Debian 11 and I searched for this package and i only found it for Ubuntu. It's a really mess with those drivers on linus and commands. Old, new commands are mixed and the same with tutorials and manuals or forum posts.

Link to comment
Share on other sites

  • 2 weeks later...
quorn23
On 4/12/2023 at 3:01 PM, hispeed said:

@cypher0117

Ok if it's only a log entry that would be fine for me.

Unfortunately when i try to install with your command the packages it tells me that they are not available.

I use Debian 11 and I searched for this package and i only found it for Ubuntu. It's a really mess with those drivers on linus and commands. Old, new commands are mixed and the same with tutorials and manuals or forum posts.

That gpg key and repository are for ubuntu, they won't help you much on Debian. TL;DR you might only need the proper syntax to enable the GPU at the bottom of my post.

 

sudo apt-get -s purge 'nvidia-*'

Then do a

sudo update-initramfs -u

After that (or on a clean install)

sudo nano /etc/apt/sources.list

and change the line deb http://deb.debian.org/debian/ bullseye main so it looks like

deb http://deb.debian.org/debian/ bullseye main contrib non-free

Ctrl +x to save, hit Y for yes

Now install the Debian 11 driver:

sudo apt update
sudo apt -y install nvidia-driver firmware-misc-nonfree
sudo shutdown -r now

You might get a screen that nouveau is enabled and that you need to reboot, which we gonna do anyways, last command will make your instance reboot.

Once rebooted and back logged in give

nvidia-smi

a try.

If that works, proceed with enabling nivida for docker, see the link to the post ^ on top of this site, the tl;dr for this is:

sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Finally proceed with adding your gpu properly.

ie.

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu] 

 

Docker-compose up and voila.

 

Side note:

If nvidia-smi doesn't show your card, it might be related to secure boot, have a read here https://wiki.debian.org/NvidiaGraphicsDrivers#Debian_11_.22Bullseye.22

I had the issue on proxmox as the vm bios had it enabled, i ended up disabling secure boot for the vm as i don't need it, but mentioning it in case someone struggles.
(Both, barebone and proxmox vm, tested with lscr.io/linuxserver/emby:latest)

Edited by quorn23
  • Agree 1
Link to comment
Share on other sites

quorn23

Not sure why i can't edit my post anymore @Luke

The enabling nvidia for docker part is missing a piece. Should be replaced with:

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

 

Link to comment
Share on other sites

7 minutes ago, quorn23 said:

Not sure why i can't edit my post anymore @Luke

The enabling nvidia for docker part is missing a piece. Should be replaced with:

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

 

What part exactly did you change?

Link to comment
Share on other sites

quorn23
50 minutes ago, Luke said:

What part exactly did you change?

The block under "If that works, proceed with enabling nivida for docker, see the link to the post ^ on top of this site, the tl;dr for this is:"

needs to be replaced, adding the repo part is missing.

the block:

sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

 

  • Thanks 1
Link to comment
Share on other sites

hispeed

Hi @quorn23 and @Luke@softworkz

I can confirm the steps from quorn23 from post fixed my problem. I recommend to everyone to comment out for the installation every other repository which is activated.

It has something to do with the driver and I had the wrong one.

First i didn't enter my emby premiere key for tests and now see at the end it works perfectly.

I have a NVIDIA Quadro P2000 (Dell Version) in a HP DL380 G9 Server and I use ESXI V.7.X on latest Debian as VM with Docker CE and Portainer. Happy weekend after hours spending on this topic I got it working. No stocking of the movies and you can even play it through a openvpn if you have enough UL/DL.

image.thumb.png.19bed108b1e6abb051fb1023d3e35ca0.png

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

I am not able to get it to use Hardware Transcoding. Every time I play a video that is transcoding, its using cpu

I made sure I did all of the steps above that quorn23 posted above.

In Emby it can see my card

I had this when I ran docker compose

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

 

Screenshot2023-06-23at3_09_48PM.png.aa9d088aa05be9009070c78cf4af33b1.png

Link to comment
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...