Bhyve AMDVI support in FreeNAS

Steasenburger

Explorer
Joined
Feb 12, 2020
Messages
52
Hi there,
I've opened another topic recently, which was dealing with a networking problem, but my virtualization plans failed because AMDVI is apparently not enabled in FreeNAS.
This is offtopic from the original thread and I guess many people didn't read my question at the end, so I am creating a new topic for this problem.

I need this specific feature because I want to pass through a USB controller to my Linux VM where I can use the existing drivers.
This topic here on the FreeBSD forums pointed to this commit, which seems to be responsible for the added support.
The commit is from 2017 so i thought "maybe this feature could be available in FreeNAS 11.3 but I just don't know how to activate it...?".

So the questions are : Is the AMDVI virtualization feature not enabled in FreeNAS 11.3? Can it be enabled (by compiling a new kernel (how?) as @Samuel Tai pointed out)? Will it be enabled in FreeNAS 12?
Thank you in advance :)
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Here's the bhyve wiki on pass-through, including AMD-Vi: https://wiki.freebsd.org/bhyve/pci_passthru
  1. You'll need the PCI address of the card to pass-through, from dmesg.
  2. Then, you'll need to set a loader tunable pptdevs with the PCI address of the card to pass-through. Reboot, and check dmesg again to verify the kernel didn't grab the card on boot this time.
  3. You'll need to use iohyve to create the pass-through, as the GUI VM interface doesn't allow configuring pass-through.
  4. Finally, for AMD-Vi, you'll need to set a loader tunable hw.vmm.amdvi.enable=1, and reboot.
 

Steasenburger

Explorer
Joined
Feb 12, 2020
Messages
52
Yeah thank you very much, but I've already done all of these steps as you might remember from this thread over here ;)
The problem was, that the hw.vmm.amdivi.enable tunable was not existing and so the VM (I am using vm-bhyve instead of iohyve) cannot be started.
That's why I started a new thread in the first place.
My questions still remain.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
I don't know if this would work or not, but you could try installing FreeBSD 11.3 in a VM on your PC, and then scp over the vmm.ko there to your FreeNAS box.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Save the original vmm.ko just to be sure.
 

Steasenburger

Explorer
Joined
Feb 12, 2020
Messages
52
I've created a virtual box FreeBSD 11.3 instance, but still even after loading the vmm kernel module the hw. vmm.amdvi settings do not show up...?
I don't think the kernel module will change much then right?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Doesn't look like it.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
There's a UI option in 12, see https://jira.ixsystems.com/browse/NAS-100045 . I'm assuming the pptdevs has to come first so the UI option has something to grab onto. Haven't tested it yet, but shall.

Edit: First test successful. Two loader variables. vmm_load YES and pptdevs 0/20/0 (my board's USB controller). Presto, it shows up as an available passthrough device in the Virtual Machine UI.
 
Last edited:

Steasenburger

Explorer
Joined
Feb 12, 2020
Messages
52
Wow that's finally some really great news :D
I'm looking forward to a somewhat stable Freenas 12 version so i can finally use my USB controller in the VM.
Thanks for the information
 
Top