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: Mario Marietto <marietto2008_at_gmail.com>
Date: Fri, 03 Feb 2023 13:07:42 UTC
Hello Daniel and everyone.

---> If you want to pass through the video card (as evidenced by devctl and
pptdevs) then why have the nvidia driver installed?

Why did you say this ? Are you aware of some bug that prevents a pci device
from being passed if its driver is installed ?

Maybe there is. Infact I made some progress. I have commented this line on
/etc/rc.conf :

#kld_list="nvidia nvidia-modeset"

and I've been able to detach and reattach the 4 slots of the 2080 ti. I
think that if I load the nvidia modules on the rc.conf,they interfere with
a later attaching / detaching of 1 or 2 slots of the gpu (hdac and vgapci).
Do you think that it could be caused by a bug on the nvidia driver or in
the bhyve source code ? What do you suggest I do ?

Il giorno mer 1 feb 2023 alle ore 13:49 Daniel O'Connor <darius@dons.net.au>
ha scritto:

>
>
> > 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
>
>

-- 
Mario.