Hello all,
Context
I am trying to run a program that uses Nvidia Rivermax as a regular (nonr-root) user inside an unprivileged Incus container.
The program deals with fast networked cameras.
I have passed through the NIC and related Infiniband nodes:
devchar:
path: /dev/char
readonly: "true"
source: /dev/char
type: disk
ibnic:
mtu: "9000"
nictype: physical
parent: ens1f1np1
type: nic
uverbs1:
path: /dev/infiniband/uverbs1
type: unix-char
In an privileged container, all works well (both as non-root and as root user).
Problem
In an unprivileged container, however, the program segfaults when I try to allocate a framebuffer. I can see a few failing system calls, the first one seems to be:
shmget(IPC_PRIVATE, 16777216, SHM_HUGETLB|0600) = -1 EPERM (Operation not permitted)
Therefore, I think it may be related to hugepages not being available in the unprivileged container.
Attempted solution
I then tried to set some limits and capabilities:
config:
limits.kernel.memlock: unlimited
incus config set acquisition security.syscalls.intercept.mount true
incus config set acquisition security.syscalls.intercept.mount.allowed hugetlbfs
incus config set acquisition security.syscalls.intercept.mount.shift true
I also tried to set capabilities (It definitely needs CAP_NET_RAW, even outside the container):
incus config set acquisition raw.lxc=lxc.cap.keep="ipc_lock net_raw"
But, although these get set successfully (Incus doesn’t complain), the container refuses to start with these in place. No error at all, nothing in the log. It just remains “stopped” after issuing “start”.
I’m out of ideas at the moment. Any help or pointers are greatly appreciated.
Best,
Mathijs