[SOLVED] Infiniband Device to LXC

elurex

Active Member
Oct 28, 2015
204
13
38
Taiwan
How to passthrough an infiniband device to LXC?

according to
It all can be done with lxd or lxc. But how to do it on PVE 6.1?

it needs more that just ib0 network functionality passthrough
Code:
lxc.net.1.type: phys
lxc.net.1.flags: up
lxc.net.1.link: ibp36s0d1v0
lxc.net.1.name: ib0
lxc.net.1.ipv4.address: 10.0.1.100/24

But it also needs
  • One issmX char device per function and per port
  • One umadX char device per function and per port
  • One uverbsX char device per function
in /dev/infiniband
 
I solve my own problem

For LXC.conf adds the following
Code:
lxc.cgroup.devices.allow: a 231:* rwm
lxc.cgroup.devices.allow: a 10:54 rwm
lxc.cgroup.devices.allow: a 10:229 rwm
lxc.autodev: 1
lxc.hook.autodev: /var/lib/lxc/302/mount-hook.sh
lxc.apparmor.profile: unconfined
lxc.mount.auto: cgroup:rw
lxc.mount.auto: proc:rw
lxc.mount.auto: sys:rw
lxc.net.1.type: phys
lxc.net.1.flags: up
lxc.net.1.link: ibp36s0d1v0
lxc.net.1.name: ib0
lxc.net.1.ipv4.address: 10.0.1.102/24

for mount-hook.sh
Code:
#!/bin/sh
cp -dpR /dev/infiniband* ${LXC_ROOTFS_MOUNT}/dev
mknod -m 766 ${LXC_ROOTFS_MOUNT}/dev/fuse c 10 229
 
  • Like
Reactions: roaman

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!