Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing this line [ lxc.idmap: u 0 100000 65536 ] for working mapping #7

Open
B0F1B0 opened this issue May 31, 2024 · 0 comments
Open

Comments

@B0F1B0
Copy link

B0F1B0 commented May 31, 2024

I want to passthrough my iGPU /dev/dri/card0 + /dev/dri/renderD128 to LXC.

Inside of LXC i need the group video and render which is in LXC:

getent group video | cut -d : -f3              # ---> 44 on LXC
getent group render | cut -d : -f3             # ---> 106 on LXC 

On my Proxmox host the group video and render is:

getent group video | cut -d : -f3              # ---> 44 on Proxmox
getent group render | cut -d : -f3             # ---> 104 on Proxmox

When i run your python-script with this:
python main.py :44=:44 :106=:104

i get the following mapping syntax:

 # Add to /etc/pve/lxc/<container_id>.conf:
lxc.idmap: g 0 100000 44
lxc.idmap: g 44 44 1
lxc.idmap: g 45 100045 61
lxc.idmap: g 106 104 1
lxc.idmap: g 107 100107 65429

# Add to /etc/subuid:

# Add to /etc/subgid:
root:44:1
root:104:1

But my LXC Container does not start. Only when i add this line lxc.idmap: u 0 100000 65536 above your mapping, my Container will start and i see the group video and render in my LXC:

This is my working mapping for lxc:

lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
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
lxc.idmap: u 0 100000 65536
lxc.idmap: g 0 100000 44
lxc.idmap: g 44 44 1
lxc.idmap: g 45 100045 61
lxc.idmap: g 106 104 1
lxc.idmap: g 107 100107 65429

this is how it looks like in lxc for /dev/dri:

ls -al /dev/dri/

crw-rw---- 1 nobody video   226,   0 May 30 19:28 card0
crw-rw---- 1 nobody render  226, 128 May 30 19:28 renderD128

can you please give me some advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant