There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

NVIDIA GPU on a docker headless system

Hi there! I have an old pc that I use as a server (I use Ubuntu Server) and I would like to add a NVIDIA 1050 to it (for jellyfin and guacamole).

In the past I tried to do it and somehow I corrupted the system when installing the video drivers, I have always had complications when installing NVIDIA drivers on Linux.

Could any of you help me know what is the right way to install the video drivers on a headless system and use it correctly with docker compose?

Thanks in advance šŸ˜„

vynlwombat ,

What went wrong last time you tried installing the drivers?

Ubuntu has Nvidia drivers in the official repos: cyberciti.biz/ā€¦/ubuntu-linux-install-nvidia-driveā€¦

Nvidia also has a docker image for GPUs: docs.nvidia.com/datacenter/ā€¦/install-guide.html

Trincapinones OP , (edited )

Thanks for the help! Iā€™m trying to install the driver from the official repo but I donā€™t know what version shoud I use for a headless docker setup with a 1050.

I think thatā€™s what went wrong last time, I tried to install the driver from the NVIDIA documentation thinking that ā€œIā€™ll just workā€ just like in windows šŸ˜“

Edit: Iā€™ve solved it, now it works perfectly, Thanks again

possiblylinux127 ,

A assume you already have the Nvidia card? If you are buying one go for amd

m12421k ,

not exactly what you want. but check out gaming on whales Wolf docs. itā€™s configured for gpu accelerated X11 apps on docker. if I recall correctly one of the documents explained settings up nvidia drivers on docker completely.

abeltramo ,
@abeltramo@lemmy.world avatar

Wow itā€™s the first time that I see someone suggesting my project out in the wild, thanks! Hereā€™s the Wolf quickstart guide

netwren ,

Not docker but you could do k3s and use the Nvidia GPU operator to manage installing video drivers for you on your single node cluster.

Trincapinones OP ,

I didnā€™t know about it, thanks! Iā€™ll give it a try šŸ˜„

netwren ,

It actually was pretty straightforward. Saying this from experience as I used a tensortt container image with a 1060 for image clarification

notfromhere ,

Do you have a link to a tutorial on this? Iā€™ve been thinking about adding my amd64 server with an nVidia GPU to my Raspberry Pi K3s cluster.

netwren ,

No! Maybe I should work on this because it was fairly simple for me to do after some research.

notfromhere ,

That would be pretty dope. If you end up writing it up donā€™t forget about me šŸ˜

fraydabson , (edited )

Once you do get the drivers installed properly as per your OS (speaking of, which distro are you using? Edit: nvm I see you are on Ubuntu), here are the steps to give docker access to it: docs.nvidia.com/datacenter/ā€¦/install-guide.html

Trincapinones OP ,

Thank you! Last time I used the official desktop drivers because most guides recommended them. When I install the NVIDIA Container Toolkit, I can include the GPU in the runtime of the container and it should work, right?

fraydabson , (edited )

I used the desktop drivers as well (on arch from the extra repo) for my headless arch server.

Regarding nvidia container toolkit once it was installed I added this to my Jellyfin docker compose:


<span style="color:#323232;">deploy:
</span><span style="color:#323232;">      resources:
</span><span style="color:#323232;">        reservations:
</span><span style="color:#323232;">          devices:
</span><span style="color:#323232;">            - driver: nvidia
</span><span style="color:#323232;">              capabilities: [gpu]
</span>

Then to confirm, I did docker exec -it jellyfin nvidia-smi Which responded with my GPU. Note that (for me) the ā€œprocessesā€ part of nvidia-smi comes up blank, even when Jellyfin is using it. I can tell it is working though from jellyfin logs and when it is not using it, instead of being blank it says ā€œno processesā€

Edit for formatting and to add that I believe I also had to add an environment variable to jellyfin (I am using lsioā€™s version)


<span style="color:#323232;">      - NVIDIA_DRIVER_CAPABILITIES=all
</span><span style="color:#323232;">      - NVIDIA_VISIBLE_DEVICES=all
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • ā€¢
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines