Finding GPU Passthrough LXC Path

Andy Prime

New Member
Apr 23, 2025
12
1
3
I'm struggling to pass one of my two Nvidia GPUs in my z8z4 system to my instance of Frigate on an LXC container. I can pass them in the GUI for my VMs, added as a raw device, but I'm not sure how to find the path name for the LXC. Any help or guidance would be greatly appreciated!!

I tried to run a tutorial on youtube that helps with GPU passthroughs and LXC containers that use instances of AI. The video suggested I install the latest driver of Nvidia, but the driver errored out with "Unable to find the kernel source tree for the current running kernel"
 
Looks like
Code:
/dev/dri/renderD128
seems to not be found
Screenshot 2025-09-27 173942.png

I followed a few of your steps, although if I assign one of the paths the whole CT crashes and I have to restore from a backup. Do you think there is a setup for the GPUs that I need to run so that a path shows up for them?

Screenshot 2025-09-27 194138.png
 
Please check that the GPU driver is loaded via
Bash:
lspci -vnnk | awk '/VGA/{print $0}' RS= | grep -Pi --color "^|(?<=Kernel driver in use: |Kernel modules: )[^ ]+"
Also check what nvidia-smi says.
the whole CT crashes
What does pct start CTIDHERE --debug say?
 
Thank you for your responses btw. I greatly appreciate the help!

This is what I have for the Bash Code. I don't see a line item for a Driver.
Screenshot 2025-09-27 213100.png

This was the CT crash.

Screenshot 2025-09-27 213129.png
 
Make sure the nvidia drivers are installed and active on the node. The article has sections about that. I recommend the apt way if possible.
My "script" does not add these paths/devices to your CT. Please also share the debug output and the CT config. I'd recommend you use a default debian template, not a helper script.
 
Last edited:
Loading the driver worked great. I see the following now.

user userName group groupName device
0 root 104 render /dev/dri/renderD128 /dev/dri/renderD128,gid=104
0 root 104 render /dev/dri/renderD129 /dev/dri/renderD129,gid=104
0 root 44 video /dev/dri/card0 /dev/dri/card0,gid=44
0 root 44 video /dev/dri/card1 /dev/dri/card1,gid=44
0 root 44 video /dev/dri/card2 /dev/dri/card2,gid=44


Unfortunately adding these still crashes the CT. Where do I find the debug output? Is this the same as the system log? and what are you looking for on the CT config? is this a file?
 
I already gave you the debug command but here are both.
Bash:
pct start CTIDHERE --debug
pct config CTIDHERE
 
Bash:
root@zeta:~# pct config 100
arch: amd64
cores: 12
description: https%3A//www.youtube.com/watch?v=ICuWjPp3L9Q%0A
dev0: /dev/dri/renderD128,gid=104
dev1: /dev/dri/renderD129,gid=104
dev2: /dev/dri/card0,gid=44
dev3: /dev/dri/card1,gid=44
dev4: /dev/dri/card2,gid=44
features: nesting=1
hostname: frigate
memory: 4096
net0: name=eth0,bridge=vmbr0,hwaddr=BC:24:11:E8:AC:B0,ip=dhcp,type=veth
onboot: 1
ostype: debian
rootfs: rpool2:subvol-100-disk-0,size=20G
swap: 512
tags: community-script;nvr
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/serial/by-id  dev/serial/by-id  none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0       dev/ttyUSB0       none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1       dev/ttyUSB1       none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0       dev/ttyACM0       none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM1       dev/ttyACM1       none bind,optional,create=file
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file

Bash:
root@zeta:~# pct start 100 --debug
safe_mount: 1425 No such file or directory - Failed to mount "/dev/serial/by-id" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/serial/by-id"
safe_mount: 1425 No such file or directory - Failed to mount "/dev/ttyUSB0" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyUSB0"
safe_mount: 1425 No such file or directory - Failed to mount "/dev/ttyUSB1" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyUSB1"
safe_mount: 1425 No such file or directory - Failed to mount "/dev/ttyACM0" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyACM0"
safe_mount: 1425 No such file or directory - Failed to mount "/dev/ttyACM1" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyACM1"
run_buffer: 571 Script exited with status 17
lxc_setup: 3948 Failed to run autodev hooks
do_start: 1273 Failed to setup container "100"
sync_wait: 34 An error occurred in another process (expected sequence number 4)
__lxc_start: 2114 Failed to spawn container "100"
onfig_v2:815 - Processing "[all]"
INFO     seccomp - ../src/lxc/seccomp.c:parse_config_v2:815 - Processing "kexec_load errno 1"
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding native rule for syscall[246:kexec_load] action[327681:errno] arch[0]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[246:kexec_load] action[327681:errno] arch[1073741827]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[246:kexec_load] action[327681:errno] arch[1073741886]
INFO     seccomp - ../src/lxc/seccomp.c:parse_config_v2:815 - Processing "open_by_handle_at errno 1"
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding native rule for syscall[304:open_by_handle_at] action[327681:errno] arch[0]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[304:open_by_handle_at] action[327681:errno] arch[1073741827]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[304:open_by_handle_at] action[327681:errno] arch[1073741886]
INFO     seccomp - ../src/lxc/seccomp.c:parse_config_v2:815 - Processing "init_module errno 1"
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding native rule for syscall[175:init_module] action[327681:errno] arch[0]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[175:init_module] action[327681:errno] arch[1073741827]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[175:init_module] action[327681:errno] arch[1073741886]
INFO     seccomp - ../src/lxc/seccomp.c:parse_config_v2:815 - Processing "finit_module errno 1"
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding native rule for syscall[313:finit_module] action[327681:errno] arch[0]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[313:finit_module] action[327681:errno] arch[1073741827]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[313:finit_module] action[327681:errno] arch[1073741886]
INFO     seccomp - ../src/lxc/seccomp.c:parse_config_v2:815 - Processing "delete_module errno 1"
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding native rule for syscall[176:delete_module] action[327681:errno] arch[0]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[176:delete_module] action[327681:errno] arch[1073741827]
INFO     seccomp - ../src/lxc/seccomp.c:do_resolve_add_rule:572 - Adding compat rule for syscall[176:delete_module] action[327681:errno] arch[1073741886]
INFO     seccomp - ../src/lxc/seccomp.c:parse_config_v2:1036 - Merging compat seccomp contexts into main context
INFO     start - ../src/lxc/start.c:lxc_init:882 - Container "100" is initialized
INFO     cgfsng - ../src/lxc/cgroups/cgfsng.c:cgfsng_monitor_create:1669 - The monitor process uses "lxc.monitor/100" as cgroup
DEBUG    storage - ../src/lxc/storage/storage.c:storage_query:231 - Detected rootfs type "dir"
INFO     cgfsng - ../src/lxc/cgroups/cgfsng.c:cgfsng_payload_create:1777 - The container process uses "lxc/100/ns" as inner and "lxc/100" as limit cgroup
INFO     start - ../src/lxc/start.c:lxc_spawn:1769 - Cloned CLONE_NEWNS
INFO     start - ../src/lxc/start.c:lxc_spawn:1769 - Cloned CLONE_NEWPID
INFO     start - ../src/lxc/start.c:lxc_spawn:1769 - Cloned CLONE_NEWUTS
INFO     start - ../src/lxc/start.c:lxc_spawn:1769 - Cloned CLONE_NEWIPC
INFO     start - ../src/lxc/start.c:lxc_spawn:1769 - Cloned CLONE_NEWNET
INFO     start - ../src/lxc/start.c:lxc_spawn:1769 - Cloned CLONE_NEWCGROUP
DEBUG    start - ../src/lxc/start.c:lxc_try_preserve_namespace:140 - Preserved mnt namespace via fd 18 and stashed path as mnt:/proc/469281/fd/18
DEBUG    start - ../src/lxc/start.c:lxc_try_preserve_namespace:140 - Preserved pid namespace via fd 19 and stashed path as pid:/proc/469281/fd/19
DEBUG    start - ../src/lxc/start.c:lxc_try_preserve_namespace:140 - Preserved uts namespace via fd 20 and stashed path as uts:/proc/469281/fd/20
DEBUG    start - ../src/lxc/start.c:lxc_try_preserve_namespace:140 - Preserved ipc namespace via fd 21 and stashed path as ipc:/proc/469281/fd/21
DEBUG    start - ../src/lxc/start.c:lxc_try_preserve_namespace:140 - Preserved net namespace via fd 22 and stashed path as net:/proc/469281/fd/22
DEBUG    start - ../src/lxc/start.c:lxc_try_preserve_namespace:140 - Preserved cgroup namespace via fd 23 and stashed path as cgroup:/proc/469281/fd/23
WARN     cgfsng - ../src/lxc/cgroups/cgfsng.c:cgfsng_setup_limits_legacy:3432 - Invalid argument - Ignoring legacy cgroup limits on pure cgroup2 system
INFO     cgfsng - ../src/lxc/cgroups/cgfsng.c:cgfsng_setup_limits:3528 - Limits for the unified cgroup hierarchy have been setup
INFO     utils - ../src/lxc/utils.c:run_script_argv:587 - Executing script "/usr/share/lxc/lxcnetaddbr" for container "100", config section "net"
DEBUG    network - ../src/lxc/network.c:netdev_configure_server_veth:876 - Instantiated veth tunnel "veth100i0 <--> vethEWApSo"
DEBUG    conf - ../src/lxc/conf.c:lxc_mount_rootfs:1240 - Mounted rootfs "/var/lib/lxc/100/rootfs" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs" with options "(null)"
INFO     conf - ../src/lxc/conf.c:setup_utsname:679 - Set hostname to "frigate"
DEBUG    network - ../src/lxc/network.c:setup_hw_addr:3863 - Mac address "BC:24:11:E8:AC:B0" on "eth0" has been setup
DEBUG    network - ../src/lxc/network.c:lxc_network_setup_in_child_namespaces_common:4004 - Network device "eth0" has been setup
INFO     network - ../src/lxc/network.c:lxc_setup_network_in_child_namespaces:4061 - Finished setting up network devices with caller assigned names
INFO     conf - ../src/lxc/conf.c:mount_autodev:1023 - Preparing "/dev"
INFO     conf - ../src/lxc/conf.c:mount_autodev:1084 - Prepared "/dev"
DEBUG    conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:539 - Invalid argument - Tried to ensure procfs is unmounted
DEBUG    conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:562 - Invalid argument - Tried to ensure sysfs is unmounted
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2219 - Remounting "/sys/fs/fuse/connections" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/sys/fs/fuse/connections" to respect bind or remount options
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2238 - Flags for "/sys/fs/fuse/connections" were 4110, required extra flags are 14
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2282 - Mounted "/sys/fs/fuse/connections" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/sys/fs/fuse/connections" with filesystem type "none"
ERROR    utils - ../src/lxc/utils.c:safe_mount:1425 - No such file or directory - Failed to mount "/dev/serial/by-id" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/serial/by-id"
INFO     conf - ../src/lxc/conf.c:mount_entry:2210 - No such file or directory - Failed to mount "/dev/serial/by-id" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/serial/by-id" (optional)
ERROR    utils - ../src/lxc/utils.c:safe_mount:1425 - No such file or directory - Failed to mount "/dev/ttyUSB0" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyUSB0"
INFO     conf - ../src/lxc/conf.c:mount_entry:2210 - No such file or directory - Failed to mount "/dev/ttyUSB0" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyUSB0" (optional)
ERROR    utils - ../src/lxc/utils.c:safe_mount:1425 - No such file or directory - Failed to mount "/dev/ttyUSB1" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyUSB1"
INFO     conf - ../src/lxc/conf.c:mount_entry:2210 - No such file or directory - Failed to mount "/dev/ttyUSB1" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyUSB1" (optional)
ERROR    utils - ../src/lxc/utils.c:safe_mount:1425 - No such file or directory - Failed to mount "/dev/ttyACM0" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyACM0"
INFO     conf - ../src/lxc/conf.c:mount_entry:2210 - No such file or directory - Failed to mount "/dev/ttyACM0" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyACM0" (optional)
ERROR    utils - ../src/lxc/utils.c:safe_mount:1425 - No such file or directory - Failed to mount "/dev/ttyACM1" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyACM1"
INFO     conf - ../src/lxc/conf.c:mount_entry:2210 - No such file or directory - Failed to mount "/dev/ttyACM1" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/ttyACM1" (optional)
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2219 - Remounting "/dev/fb0" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/fb0" to respect bind or remount options
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2238 - Flags for "/dev/fb0" were 4098, required extra flags are 2
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2282 - Mounted "/dev/fb0" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/fb0" with filesystem type "none"
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2219 - Remounting "/dev/dri" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/dri" to respect bind or remount options
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2238 - Flags for "/dev/dri" were 4098, required extra flags are 2
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2282 - Mounted "/dev/dri" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/dri" with filesystem type "none"
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2219 - Remounting "/dev/dri/renderD128" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/dri/renderD128" to respect bind or remount options
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2238 - Flags for "/dev/dri/renderD128" were 4098, required extra flags are 2
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2282 - Mounted "/dev/dri/renderD128" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/dri/renderD128" with filesystem type "none"
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2282 - Mounted "proc" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/.lxc/proc" with filesystem type "proc"
DEBUG    conf - ../src/lxc/conf.c:mount_entry:2282 - Mounted "sys" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/.lxc/sys" with filesystem type "sysfs"
DEBUG    cgfsng - ../src/lxc/cgroups/cgfsng.c:__cgroupfs_mount:2187 - Mounted cgroup filesystem cgroup2 onto 20((null))
INFO     utils - ../src/lxc/utils.c:run_script_argv:587 - Executing script "/usr/share/lxcfs/lxc.mount.hook" for container "100", config section "lxc"
INFO     utils - ../src/lxc/utils.c:run_script_argv:587 - Executing script "/usr/share/lxc/hooks/lxc-pve-autodev-hook" for container "100", config section "lxc"
DEBUG    utils - ../src/lxc/utils.c:run_buffer:560 - Script exec /usr/share/lxc/hooks/lxc-pve-autodev-hook 100 lxc autodev produced output: Could not mknod /usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/dri/card2: File exists

ERROR    utils - ../src/lxc/utils.c:run_buffer:571 - Script exited with status 17
ERROR    conf - ../src/lxc/conf.c:lxc_setup:3948 - Failed to run autodev hooks
ERROR    start - ../src/lxc/start.c:do_start:1273 - Failed to setup container "100"
ERROR    sync - ../src/lxc/sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 4)
DEBUG    network - ../src/lxc/network.c:lxc_delete_network:4217 - Deleted network devices
ERROR    start - ../src/lxc/start.c:__lxc_start:2114 - Failed to spawn container "100"
WARN     start - ../src/lxc/start.c:lxc_abort:1037 - No such process - Failed to send SIGKILL via pidfd 17 for process 469304
startup for container '100' failed
 
As I said, start with a fresh debian CT. You can also try to remvoe all that stuff below tags. It is written with a normal unmodified CT/template in mind as provided by PVE.
 
Last edited: