[Bug 280161] virtualization/bhyve: gpu passthru on Windows works on the 14.0,but stopped on 14.1 : looking for a regression using git-bisect,but got error : pci_iov: Refuse to create VFs which require ARI if ARI is not available.

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 06 Jul 2024 16:58:34 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280161

            Bug ID: 280161
           Summary: virtualization/bhyve: gpu passthru on Windows works on
                    the 14.0,but stopped on 14.1 : looking for a
                    regression using git-bisect,but got error : pci_iov:
                    Refuse to create VFs which require ARI if ARI is not
                    available.
           Product: Base System
           Version: 14.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bhyve
          Assignee: virtualization@FreeBSD.org
          Reporter: marietto2008@gmail.com

Hello.

The gpu passthru for the Windows VMs and the nvidia gpus works for a limited
number of users. The special thing is that it is working for me at least on the
14.0. The reason why it works is buried between the patches that have been
developed for the stock 14.0 and maybe another patch developed for the 14.1
broke something on the 14.0. I've asked some help on the FreeBSD forums and the
guys suggested me to look for a regression. They suggested to use git bisect.
This is what I should try to do :

"If you are sure that it is working on a regular 14.0-RELEASE, then you could
either use git-bisect to find the commit that did the regression or attempt to
revert any patch from 14.0 to 14.1 that change anything related to bhyve.

In both case, this could result in some security risk (more security risk for
the latter I would assume) and instability.

For the following, I would suggest to do that with an empty state system: new
drive (external would be easy), remove the current drive on the machine.

Having a secondary machine for the build is in my opinion necessary, this would
allow to build on one machine, generate an image and directly boot on the test
machine the new image.

For git-bisect, you could do like that:

Go to the releng/14.1 branch, and take a note of the commit for 14.0.

Assuming that you have already cloned the freebsd src repository, you could do
the following :

git switch main
git fetch origin releng/14.0
git fetch origin releng/14.1
git log -n 1 --pretty=format:%h origin/releng/14.0
git log -n 1 --pretty=format:%h origin/releng/14.1

Which gave me for 14.0 : 5e23806790ef , and for 14.1 : dcdea9e8623e

Then do :

git bisect start
git bisect bad
git bisect good COMMIT_OF_14.0

Then every time it stop, do a full build, install, and test your setup.
If it is good, do git bisect good
Else, do git bisect bad"

I'm new of this thing,but I tried doing like this :

[root@marietto /usr]# uname -a

FreeBSD marietto 14.0-RELEASE-p6 FreeBSD 14.0-RELEASE-p6 #0: Tue Mar 26
20:26:20 UTC 2024    
root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64

[root@marietto /usr]# git clone https://git.FreeBSD.org/src.git /usr/src

Clone in '/usr/src' in corso...
remote: Enumerating objects: 4513103, done.
remote: Counting objects: 100% (383516/383516), done.
remote: Compressing objects: 100% (28936/28936), done.
remote: Total 4513103 (delta 377788), reused 354580 (delta 354580), pack-reused
4129587 (from 1)
Receiving objects: 100% (4513103/4513103), 1.64 GiB | 10.17 MiB/s, fatto.
Delta resolution: 100% (3587926/3587926), fatto.
Updating files in progress: 100% (101043/101043), fatto.

[root@marietto /usr]# cd src
[root@marietto /usr/src]# git checkout releng/14.1

Aggiornamento dei file in corso: 100% (22564/22564), fatto.
branch 'releng/14.1' set up to track 'origin/releng/14.1'.
You have switched to a new branch 'releng/14.1'

[root@marietto /usr/src]# git switch main
Aggiornamento dei file in corso: 100% (22564/22564), fatto.
Switched to branch 'main'
Your branch is updated respect to 'origin/main'.

[root@marietto /usr/src]# git fetch origin releng/14.0
Da https://git.FreeBSD.org/src
* branch                      releng/14.0 -> FETCH_HEAD

[root@marietto /usr/src]# git fetch origin releng/14.1
Da https://git.FreeBSD.org/src
* branch                      releng/14.1 -> FETCH_HEAD

[root@marietto /usr/src]# git log -n 1 --pretty=format:%h origin/releng/14.0
5e23806790ef

[root@marietto /usr/src]# git log -n 1 --pretty=format:%h origin/releng/14.1
dcdea9e8623e

[root@marietto /usr/src]==> git bisect start 5e23806790ef
You are already on 'main'
Your branch is updated respect to 'origin/main'.
status: waiting for good commit(s), bad commit known

[root@marietto /usr/src]==> git bisect bad dcdea9e8623e
status: waiting for good commit(s), bad commit known

[root@marietto /usr/src]==> git bisect good 5e23806790ef
Bisection: a merge base must be tested

after some time an error has been displayed and the job stopped.

[dde83fc4d2e6e8a3009bdfb7d14dcc8ef802b22f] pci_iov: Refuse to create VFs which
require ARI if ARI is not available.

Now I don't know what to do next. I appreciate some help from a
developer,because some patch in the 14.1 branch broke the funcionality of the
GPU passthru that it still working on 14.0 for me,but it does not work anymore
on the 14.1 after having upgraded the system using the script "freebsd-update
-r 14.1-RELEASE upgrade"

You can read the full thread of the discussion going here :

https://forums.freebsd.org/threads/is-there-a-method-to-understand-inside-which-freebsd-branch-does-my-vmm-ko-file-come-from.93690/page-4

-- 
You are receiving this mail because:
You are the assignee for the bug.