Skip to content

Conversation

scfarley
Copy link

@scfarley scfarley commented Sep 10, 2025

Following the instructions from GPU passthrough with bhyve - Corvin Köhne - EuroBSDcon 2023, a couple of additional settings are needed to pass the proper values and in the correct order:

  • passthruX_options: Options given to the passthru device to specify rom and/or bootindex.
  • bhyve_extra: Options that are passed to bhyve at the end of the command-line.

Copy link
Contributor

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

204ef50 is already in main, unless my change is incomplete 465e020. Please double check.

Passthru device backends can take options such as rom and bootindex.
Accept those via passthruX_options settings.
bhyve can be dependent upon the order of the options is receives, so add
a setting similar to bhyve_options, called bhyve_extra, that is passed
to bhyve as the last options.

"-s 31,lpc" is passed by vm-bhyve after the options provided by
bhyve_options.  However, this causes bhyve to return an error when
attempting to use GPU passthru with an Intel iGPU due to additional
options needing to be passed.

Example:
$ bhyve ... -o pci.0.31.0.pcireg.vendor=host -s 31,lpc ...
pci slot 0:31:0 already occupied!
@scfarley
Copy link
Author

204ef50 is already in main, unless my change is incomplete 465e020. Please double check.

Good catch. I removed my commit.

@michael-o
Copy link
Contributor

michael-o commented Sep 11, 2025

What is the difference betweeen bhyve_extra and bhyve_options then?

@michael-o
Copy link
Contributor

I think this needs to be split into two PRs...

@scfarley
Copy link
Author

What is the difference betweeen bhyve_extra and bhyve_options then?

The ordering of parameters. bhyve apparently cares about the order of what is on the command-line. See 572b254 If bhyve did not care, then it would be fine without the extra options at the end.

@scfarley
Copy link
Author

I think this needs to be split into two PRs...

They can be squashed during the merge or made separate. Either way is fine by me. I had only separated them to see what was being requested. Both were needed, at least at the time, for GPU passthru to work for me.

I still need to test these again as I have not tried the passthru for awhile due to other factors. Once I have setup my system and tested it, I will convert this draft to a true PR (or PR's).

@michael-o
Copy link
Contributor

I try to look at this next couple of days including the video again which I have seen already. What one should do is also update the manpage otherwise this will be lost.

metalefty and others added 9 commits September 18, 2025 22:38
UUIDs and MAC addresses are regenerated during cloning to keep them unique.
However, it takes effect on next cold-boot. If the VM is suspended, even
if MAC address and UUID are renewed, it resumes with the old MAC address
and UUID stores in the memory. This may cause potential conflict, so the
VM needs to be stopped before cloning.
    STYLE: consider using OS macro: Fx
Same with freebsd#23, localization is not needed here.
@scfarley
Copy link
Author

My apologies. I messed up the branch, but I will redo it later.

@scfarley
Copy link
Author

I am closing this PR in favor of two separate PR's:

@scfarley scfarley closed this Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants