Jump to content

midi

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by midi

  1. Hello,

    There are people with Intel or Nvidia GPUs that support vGPU partitioning or SR-IOV support, it would be nice to add mdev support to the GUI of the VM setup. This helps ease of GPU setup for VMs. I am not requesting driver support, just GUI menu support. Libvirt already supports native mdev device handling and also mdevctl helps to do the same thing.

     

    Thanks.

  2. 1 minute ago, ich777 said:

    I don't think that if you post the scripts to build the non public drivers anyone can come after you as long as you post how to legally obtain a license and the vgpu binaries which are needed to do so.

    Yeah, technically those who are into this already know where to get the drivers legally (the nvidia enterprise portal), the goal of the scripts is just patch and repack the drivers not how to get them, but I will point out how to get those.

     

    3 minutes ago, ich777 said:

    Sorry, I really can't help here because I simply don't have a card that has the capabilities to make use of a vGPU and I even don't know how this is all working.

    There is a community project to unlock the drivers to enable the vGPU capabilities to consumer graphics if you want to test, but they also support natively supported cards (like Tesla P4/P40..., they just lift some nvidia limitations). Yes it is against Nvidia's EULA, this is why I'm not sharing any files here, but anyone can get the files legally from Nvidia's Enterprise Portal.

  3. @ich777 Thanks a lot for your answer before. I was able to compile and load the vGPU guest drivers, and they're working fine. However, I have some questions:

    1) Can I post the scripts and steps to make the packages in this thread? (the user must provide the driver package from nvidia, the scripts do not download any drivers)

    2) I'm using your plugin to load and manage the GUID of the GPU for docker, however I'm having an issue with the GUID: it resets every time the vm does a cold boot, which is an inconvenience, and I'm not sure about the cause of this.

  4. Hi,

    I am using Unraid inside a vm with proxmox as a host for it. I have a vGPU setup with an nvidia card, and I need to install the grid guest drivers on unraid to get support for the vgpu hooked to it. I already read that this might be out of the scope of this project here, but I would like to know how you setup your system environment to get the kernel modules to compile. I googled for a while and I still couldn't get it working (the nvidia kernel modules would not compile properly, and my setup environment is not properly made anyways). 

    Any help or pointers would be appreciated.

  5. I'm also getting this issue in 6.11.5, if I try to shut down libvirt and restart it while docker is running, it will not start up (happens even in safe mode). The only solution is to shutdown libvirt and docker, start libvirt first then docker after it.

    Nov 28 16:04:37 X99U  emhttpd: shcmd (8076): /usr/local/sbin/mount_image '/mnt/user/system/libvirt/libvirt.img' /etc/libvirt 5
    Nov 28 16:04:37 X99U root: '/mnt/user/system/libvirt/libvirt.img' is in-use, cannot mount

    So I'm getting this when I'm trying to start libvirt, I checked with `fuser -c /path/to/libvirt.img` and the file is actually not in use (at least not that I can see that). `losetup` shows the libvirt.img file being attached to loop3 device and I cannot detach it, here are the outputs:

    root@X99U:~# losetup 
    NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                               DIO LOG-SEC
    /dev/loop1         0      0         1  1 /boot/bzmodules                           0     512
    /dev/loop2         0      0         1  0 /mnt/cache/system/docker/docker-xfs.img   1     512
    /dev/loop0         0      0         1  1 /boot/bzfirmware                          0     512
    /dev/loop3         0      0         1  0 /mnt/cache/system/libvirt/libvirt.img     1     512

    when trying to detach it

    root@X99U:~# umount -ld /dev/loop3
    umount: /dev/loop3: not mounted.
    root@X99U:~# LOOPDEV_DEBUG=all losetup -vd /dev/loop3
    922: loopdev:      CXT: [0x7ffeb1b48f20]: initialize context
    922: loopdev:      CXT: [0x7ffeb1b48f20]: init: ignore ioctls
    922: loopdev:      CXT: [0x7ffeb1b48f20]: init: loop-control detected 
    922: loopdev:      CXT: [0x7ffeb1b48f20]: /dev/loop3 name assigned
    922: loopdev:      CXT: [0x7ffeb1b48f20]: open /dev/loop3 [ro]: No such file or directory
    922: loopdev:      CXT: [0x7ffeb1b48f20]: device removed
    922: loopdev:      CXT: [0x7ffeb1b48f20]: de-initialize
    922: loopdev:      CXT: [0x7ffeb1b48f20]: closing old open fd
    922: loopdev:     ITER: [0x7ffeb1b490f8]: de-initialize

     

    The only workaround that I found is shutting libvirt and docker and starting libvirt first then docker after, or reboot the host which undesirable. Sometimes when libvirt refuses to start again, rebooting the host will show an error of an unclean shutdown and will start the parity check.

     

    Note that this only happens when I manually disable VMs in VMs Manager and then re-enable it. There is also a case where if libvirt is broken and does not start properly, restarting the array may not restart libvirt service, only a full reboot would help.

  6. I found the issue! I changed "lxc.cgroup.devices.allow" to "lxc.cgroup2.devices.allow" and now it's working!

     

    lxc.cgroup2.devices.allow = c 10:237 rwm
    lxc.cgroup2.devices.allow = b 7:* rwm
    lxc.mount.entry = /dev/loop-control dev/loop-control none bind,create=file 0 0
    lxc.mount.entry = /dev/loop4 dev/loop4 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop5 dev/loop5 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop6 dev/loop6 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop7 dev/loop7 none bind,create=file 0 0

     

    Here is the final setup, I could make it even more limited by setting `b 7:4` `b7:5` and so on to limit access to just those loop devices. There is no need to add mapper or fuse.

     

    Found the fix here: https://forum.proxmox.com/threads/lxc-dev-loop-mounting-broken-after-upgrade-to-pve-7-0.97415/post-421499

    • Like 1
  7. 4 hours ago, ich777 said:

    Can you post the full error and/or a screenshot?

     

    root@focal:~# mount 1G.img /mnt/
    mount: /mnt/: failed to setup loop device for /root/1G.img.
    root@focal:~# losetup -fP 1G.img
    losetup: 1G.img: failed to set up loop device: Operation not permitted

     

    4 hours ago, ich777 said:

    Do you have cgroup v2 enabled on Unraid? On which Unraid version are you? Can you also post the output of:

    dmesg

    after trying to start/mount the loop devices?

     

    Yes, I added `unraidcgroup2` to the boot entry, on Unraid 6.11.1.

    dmesg/journalctl does not show anything, it just errors out in the console, nothing in the logs.

    `losetup` does show that the next free loop device just fine:

     

    root@focal:~# losetup -a
    /dev/loop1: []: (/boot/bzmodules)
    /dev/loop2: []: (/mnt/cache/system/docker/docker-xfs.img)
    /dev/loop0: []: (/boot/bzfirmware)
    /dev/loop3: []: (/mnt/cache/system/libvirt/libvirt.img)
    root@focal:~# losetup -la
    NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE              DIO LOG-SEC
    /dev/loop1
                 0      0         1  1 /boot/bzmodules          0     512
    /dev/loop2
                 0      0         1  0 /mnt/cache/system/docker/docker-xfs.img
                                                                1     512
    /dev/loop0
                 0      0         1  1 /boot/bzfirmware         0     512
    /dev/loop3
                 0      0         1  0 /mnt/cache/system/libvirt/libvirt.img
                                                                1     512
    root@focal:~# losetup -f
    /dev/loop4

     

    loop devices inside the lxc and of the host:

    LXC:

    root@focal:~# ls /dev/loop* -la
    crw-rw---- 1 root disk 10, 237 Oct 18 18:08 /dev/loop-control
    brw-rw---- 1 root disk  7,   0 Oct 18 18:08 /dev/loop0
    brw-rw---- 1 root disk  7,   1 Oct 18 18:08 /dev/loop1
    brw-rw---- 1 root disk  7,   2 Oct 18 18:10 /dev/loop2
    brw-rw---- 1 root disk  7,   3 Oct 18 18:10 /dev/loop3
    brw-rw---- 1 root disk  7,   4 Oct 18 18:08 /dev/loop4
    brw-rw---- 1 root disk  7,   5 Oct 18 18:08 /dev/loop5
    brw-rw---- 1 root disk  7,   6 Oct 18 18:08 /dev/loop6
    brw-rw---- 1 root disk  7,   7 Oct 18 18:08 /dev/loop7

    Host:

    root@X99U:~# ls /dev/loop* -la
    crw-rw---- 1 root disk 10, 237 Oct 18 19:08 /dev/loop-control
    brw-rw---- 1 root disk  7,   0 Oct 18 19:08 /dev/loop0
    brw-rw---- 1 root disk  7,   1 Oct 18 19:08 /dev/loop1
    brw-rw---- 1 root disk  7,   2 Oct 18 19:10 /dev/loop2
    brw-rw---- 1 root disk  7,   3 Oct 18 19:10 /dev/loop3
    brw-rw---- 1 root disk  7,   4 Oct 18 19:08 /dev/loop4
    brw-rw---- 1 root disk  7,   5 Oct 18 19:08 /dev/loop5
    brw-rw---- 1 root disk  7,   6 Oct 18 19:08 /dev/loop6
    brw-rw---- 1 root disk  7,   7 Oct 18 19:08 /dev/loop7

     

     

  8. Thanks ich777 for this wonderful plugin, but I'm having issues mounting loop devices inside the container.

     

    I tried binding `mapper` `fuse` `loop-control` and `loop$i` devices, but losetup would always return `Operation not permitted`.

     

    Here are the additional lines I added to the config, using ubuntu/focal image:

    lxc.cgroup.devices.allow = c 10:237 rwm
    lxc.cgroup.devices.allow = b 7:* rwm
    lxc.cgroup.devices.allow = b 10:236 rwm
    lxc.cgroup.devices.allow = b 10:229 rwm
    lxc.mount.entry = /dev/loop-control dev/loop-control none bind,create=file 0 0
    lxc.mount.entry = /dev/loop0 dev/loop0 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop1 dev/loop1 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop2 dev/loop2 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop3 dev/loop3 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop4 dev/loop4 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop5 dev/loop5 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop6 dev/loop6 none bind,create=file 0 0
    lxc.mount.entry = /dev/loop7 dev/loop7 none bind,create=file 0 0
    lxc.mount.entry = /dev/mapper dev/mapper none bind,create=dir 0 0
    lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file 0 0

     

    (I know mounting loop0-3 is dangerous, that's why I'm looking for a solution.)

     

    My goal is running a script inside the lxc (and it requires mounting some block files), I do not want to mount those images on host then bind them (as the script will mount, modify, unmount and save the modification, package as a zip, remove the original file).

     

    I've seen people saying that I need to run it as privileged, but I'm not sure about that. For testing, I made a simple 1GB img file with GPT format and one partition inside, and I try to mount it (the script linked bellow breaks at the mounting part).

     

    Script in question: https://github.com/LSPosed/MagiskOnWSALocal

×
×
  • Create New...