allfro / device-mapping-manager

58 stars 9 forks source link

Run DMM directly on host? #19

Open pikeas opened 3 weeks ago

pikeas commented 3 weeks ago

DMM runs well inside Docker:

docker run \
    --rm \
    --privileged \
    --cgroupns=host \
    --pid=host \
    --userns=host \
    -v /sys:/host/sys \
    -v /var/run/docker.sock:/var/run/docker.sock \
    ghcr.io/allfro/allfro/device-mapping-manager:sha-0651661

After extracting the binary to /usr/local/bin/device-volume-driver, I ran it directly and started a Swarm service:

$ /usr/local/bin/device-volume-driver
The cgroup version for process 74971 is: 2
Checking mounts for process 74971
[id]/74971 requested a volume mount for /dev/dri at /dev/dri
The cgroup path for process 74971 is at /host/sys/fs/cgroup/system.slice/docker-[id].scope
Found device: /dev/dri/renderD128 c 226:128
Adding device rule for process 74971 at /host/sys/fs/cgroup/system.slice/docker-[id].scope
unable to open the cgroup path: no such file or directory
unable to open the cgroup path: no such file or directory

The service doesn't see the device.

How can DMM be run directly on the host?