When I try and run the command “sh -c -f /dev/nvidia-uvm” in my unprivileged container, I get the following error:
root@plex:~# sh -c -f /dev/nvidia-uvm
sh: 1: /dev/nvidia-uvm: Permission denied
Also, I have previously installed the nvidia driver in the LXC container due to following the previous guides. Is it possible this is causing an issue?
[ ! -f /dev/nvidia-uvm ] && /usr/bin/nvidia-modprobe -c0 -u
is the command you need to run outside of your config but inside config it should be
lxc.hook.pre-start: sh -c ‘[ ! -f /dev/nvidia-uvm ] && /usr/bin/nvidia-modprobe -c0 -u’
or
sh -c ‘[ ! -f /dev/nvidia-uvm ] && /usr/bin/nvidia-modprobe -c0 -u’
you can not run that command in the container itself it is meant for proxmox system shell that line of code is only looking for a device in the /dev/ location nvidia-uvm if it finds it does nothing if it is missing it runs /usr/bin/nvidia-modprobe -c0 -u to add missing /dev/
it my not be required if you hardware encoding it working without driver changes and container runtimes must have been updated remove if necessary.
you might be able to also remove the last line in config that changes ownership of /dev/nvidia* folder as it was once need you should only need LXC.Environment Variables
i have not full updated my readme on github up or in this forum. to reflect most recent changes
you could try and run the chown command on proxmox before you run CT with commands in config
this will create a temp folder to downloads nvidia drivers from nvidia website it will remove and blacklist nouveau drivers it will install NVidia Persistenced from nvidia driver package install not from repo it will install nvidia container runtime from nvidia’s github page
this will download a ubuntu 20.04 and create a new LXC CT and configure it to a basic setup of unlimited cpus 4096 memory dhcp networking and 8 gig hard drive space. it will install NVtop and the latest Plex version from plex repos i suggest you use NVtop to check your gpu loads from inside the LXC instead of nvidia-smi
if you have any further question or suggestion please if it is related to my scripts please post on my github errors or issues your having so i can track and fix them if you are doing a new install of proxmox i suggest you run
So in case anyone was scratching their head trying to get this to work on an existing container that you have NFS mounts set up for - a reminder that you can’t run the nvidia hook script on a privileged container. If your container set up as privileged to be able to mount an NFS share, this method will not work to my knowledge. There may be a workaround, but I don’t know it.
TL;DR: I should have read the thread more closely.