Re: devctl: Failed to detach pci0:1:0:0: Device busy / devctl: Failed to set pci0:1:0:0 driver to ppt: Device busy

From: Daniel O'Connor <darius_at_dons.net.au>
Date: Wed, 01 Feb 2023 12:48:58 UTC

> On 1 Feb 2023, at 21:41, Mario Marietto <marietto2008@gmail.com> wrote:
> ---> Do you have 'vmm_load="YES"' in loader.conf ?
> 
> yes.
> 
> ---> If you want to pass through the video card (as evidenced by devctl and pptdevs) then why have the nvidia driver installed?
> 
> because I have 3 gpus on my PC. I use the intel gpu on the host ; I would like to use the nvidia gtx 1060 within a bhyve Linux vm and the 2080 ti with the Linuxulator to run stable diffusion,or vice versa. Stable diffusion needs pytorch + cuda and they need the nVidia driver installed on FreeBSD and the modules loaded.
> 
> My goal is to run stable diffusion and a bhyve / linux vm +my nvidia gpus attached.

I note that https://wiki.freebsd.org/bhyve/pci_passthru says "Note: VGA / GPU pass-through devices are not currently supported" so perhaps that is why it is ignoring your pptdevs line.

Although that said some googling suggests that is not the case so I don't know, unfortunately I haven't tried it myself.

There are some threads about it on the forums, eg:
https://forums.freebsd.org/threads/bhyve-gpu-pass-through.83152/

Those suggest that modifications to bhyve are required before it will work properly but none of them are for vmm that I can see.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum