Solved Trying to understand why only some kind of vmm.ko module allows to passthru my nvidia GPU to a WIndows 11 vm

but the code of the nvidia driver for FreeBSD is the same code of the Linux driver.
It doesn't matter. The problem arises from the Nvidia driver in your Windows guest. Therefore, the "Nvidia Windows driver".

nvidia does not care about FreeBSD.
That is absolutely ungrateful. Nvidia is - as per my knowledge - the only large consumer hardware manufacturer providing FreeBSD drivers. If they would not care about FreeBSD, they would not provide the drivers. Even if it's just the Linux drivers with maybe some wrappers it's still work for them - work they could very easily not do anymore.
Don't make me get in my car just to come over there to slap some decency & gratitude into you (joke). Show some gratitude.

Some parts of the FreeBSD code needs parts of Linux code. Maybe when it will become totally independent from Linux and will have acquired much more popularity, nvidia will start to consider it more as a different OS from Linux.
I think you have history all backwards here. BSD existed long before Linux (not that it matters).
FreeBSD providing Linux binary compatibility is a choice by the FreeBSD distribution for practical reasons - something that other BSDs don't do.
Other than that, BSD is not exactly gaining popularity over Linux if you look at the current course of things (which, to a large portion, is people migration from non-BSD systems over to Linux systems).
If we get more nit-picky: FreeBSD does not need Linux code. FreeBSD provides a binary compatibility layer for binaries designed to interface the Linux kernel. Two very different things.
 
I'd even add that FreeBSD itself might benefit from newbies being able to passthru their NVIDIA gpu to a Windows virtual machine, where they can play. In that way, while they play, they might learn something about the host system that allows them to do it. Better than nothing. Otherwise, we'll lose those users entirely.
 
---> Don't make me get in my car just to come over there to slap some decency & gratitude into you (joke). Show some gratitude.

I can show gratitude,but not for such big companies like nvidia. Different reasons had Linus to blame nvidia 10 years ago :


but even today there are reasons for us to still blame it for a lot of reasons. I don't even hate Nvidia,but the its way of doing business, its way of pricing, of selling its products, of treating its users, as well as the quality of its technical choices used to create its drivers. At the end of the day the problems don't come only from nvidia,but all those companies that act like Nvidia.
 
It doesn't matter. The problem arises from the Nvidia driver in your Windows guest. Therefore, the "Nvidia Windows driver".


That is absolutely ungrateful. Nvidia is - as per my knowledge - the only large consumer hardware manufacturer providing FreeBSD drivers. If they would not care about FreeBSD, they would not provide the drivers. Even if it's just the Linux drivers with maybe some wrappers it's still work for them - work they could very easily not do anymore.
Don't make me get in my car just to come over there to slap some decency & gratitude into you (joke). Show some gratitude.


I think you have history all backwards here. BSD existed long before Linux (not that it matters).
FreeBSD providing Linux binary compatibility is a choice by the FreeBSD distribution for practical reasons - something that other BSDs don't do.
Other than that, BSD is not exactly gaining popularity over Linux if you look at the current course of things (which, to a large portion, is people migration from non-BSD systems over to Linux systems).
If we get more nit-picky: FreeBSD does not need Linux code. FreeBSD provides a binary compatibility layer for binaries designed to interface the Linux kernel. Two very different things.

Without the linux compatibility we will not have any nvidia driver. We need Linux.
 
That is absolutely ungrateful. Nvidia is - as per my knowledge - the only large consumer hardware manufacturer providing FreeBSD drivers. If they would not care about FreeBSD, they would not provide the drivers. Even if it's just the Linux drivers with maybe some wrappers it's still work for them - work they could very easily not do anymore.
I'll second this. When I asked NVIDIA to include Vulkan support in their FreeBSD drivers I looked up what this actually means for them. Looking at the prices quoted on the Khronos website I'd be more than thankful that they went through this specifically for us FreeBSD folks.
Without the linux compatibility we will not have any nvidia driver. We need Linux.
Source for that statement? The native NVIDIA driver doesn't need Linux compatibility, it is an option in the port.
 
Sorry for the mistake. I believed the nvidia driver for FreeBSD had depended on the LinuxKPI,but according with this thread :

https://forums.freebsd.org/threads/do-all-graphics-drivers-require-linuxulator-or-just-nvidia.88835/

it does not seems. So,ok,+1 for Nvidia,but -1 because the next statement :

Guys gave the necessary explanations but in nutshell: Intel and AMD drivers are open source and Nvidia driver is proprietary. Nvidia releases official driver for FreeBSD, but Intel and AMD using Linux drivers that are run by a compatibility layer called LinuxKPI. I think you're confusing LinuxKPI and Linuxulator. LinuxKPI is used to run Linux kernel drivers and Linuxulator to run Linux apps (on the top of kernel).
 
Look at NVIDIA Virtual GPU Software Latest Release. There's no mention of bhyve. You faking it to KVM is lucky quirk as I mentioned already. Don't be surprised if you hit a problem where driver may require something that KVM has and bhyve doesn't do.

Last thing I'd want to get into: licensing. If my customers ask for pass-through on our virt environment I'd point them to sales and legal department.
 
Last thing I'd want to get into: licensing. If my customers ask for pass-through on our virt environment I'd point them to sales and legal department.

I don't know nothing about commercial licenses and about the use that a company can do with the hypervisor. I'm an home user. I think that the gpu passthru is good for home users,who likes to play games (infact there is a good movement on Linux thanks to qemu+kvm,so why this shouldn't happen even on FreeBSD with bhyve ? if it happens it means that it is enough stable and mature and known) and to run some few Windows only software.

Anyway,my previous statement,that FreeBSD needs Linux seems to be true :

FreeBSD relies on LinuxKPI to power essential desktop features like graphics drivers and wireless networking. The drm-kmod package includes Linux drivers for AMD/Intel graphics and is able to compile and run smoothly on FreeBSD using LinuxKPI. Intel wireless networking through iwlwifi is also functional and is in FreeBSD base thanks to Bjoern Zeeb.
 
I'd even add that FreeBSD itself might benefit from newbies being able to passthru their NVIDIA gpu to a Windows virtual machine, where they can play. In that way, while they play, they might learn something about the host system that allows them to do it. Better than nothing. Otherwise, we'll lose those users entirely.
A new user is better off trying to use FreeBSD rather than virtualizing Windows on top of FreeBSD. Virtualization is an advanced topic on every OS in existence.
I can show gratitude,but not for such big companies like nvidia.
For the record, I have no love for big tech and many other large companies. But sometimes, you have to be thankful for the support we're getting. The nvidia-driver port has been in existence since 2003 and was production quality back then! LinuxKPI is a recent addition and adds calls to make it easier to port drivers to FreeBSD. The only reason this was needed is specifically because Intel nor AMD (and other hardware manufacturers) would in fact support FreeBSD.
Anyway,my previous statement,that FreeBSD needs of Linux seems to be true :
LinuxKPI is the glue to make it easier for volunteers to port existing AMD and Intel drivers. You're turning things around: FreeBSD doesn't need Linux, but hardware manufacturers only support Linux API so that's why this glue was written. Your statement is misleading. Question to you: is everything in those drivers open-source or is it just an open-source loader loading a binary blob, just like it is with NVIDIA?
It's funny that first you have the need to diss NVIDIA and now you have the need to use the Intel/AMD graphics drivers to "prove" that FreeBSD can't exist without Linux or something. Whatever, there's no point addressing the misinformation here further.

That said, in order to add something useful to this thread: if the (Windows) NVIDIA drivers (and probably AMD/Intel as well) don't recognize bhyve as a Hypervisor, make an account on the NVIDIA forum and ask if it's possible to add bhyve to the "known hypervisors list" or something. If you ask nicely they probably will.
 
A new user is better off trying to use FreeBSD rather than virtualizing Windows on top of FreeBSD. Virtualization is an advanced topic on every OS in existence.

For the record, I have no love for big tech and many other large companies. But sometimes, you have to be thankful for the support we're getting. The nvidia-driver port has been in existence since 2003 and was production quality back then! LinuxKPI is a recent addition and adds calls to make it easier to port drivers to FreeBSD. The only reason this was needed is specifically because Intel nor AMD (and other hardware manufacturers) would in fact support FreeBSD.

LinuxKPI is the glue to make it easier for volunteers to port existing AMD and Intel drivers. You're turning things around: FreeBSD doesn't need Linux, but hardware manufacturers only support Linux API so that's why this glue was written. Your statement is misleading. Question to you: is everything in those drivers open-source or is it just an open-source loader loading a binary blob, just like it is with NVIDIA?
It's funny that first you have the need to diss NVIDIA and now you have the need to use the Intel/AMD graphics drivers to "prove" that FreeBSD can't exist without Linux or something. Whatever, there's no point addressing the misinformation here further.

That said, in order to add something useful to this thread: if the (Windows) NVIDIA drivers (and probably AMD/Intel as well) don't recognize bhyve as a Hypervisor, make an account on the NVIDIA forum and ask if it's possible to add bhyve to the "known hypervisors list" or something. If you ask nicely they probably will.

Can you give me 3 reasons why I should be grateful to nVidia ? I mean,for me it's not enough to say "they make the drivers for us and that's it" ; I would like to know why,a so big company like nVidia,that don't do nothing for nothing,offers to the FreeBSD users the drivers for their GPU,for an operatyng system that claims to be "the power to serve(r)" ; and in the server area there is no need to use the graphical part,the OS can be enterely used from the command line,while nVidia is the leader of the games and the desktop / home user market segment". In addition,Nvidia didn't offer to us neither the support for CUDA,maybe because they don't think that this OS is relevant in the Artificial Intelligence Computing area,also. Very thanks.
 
One thing to note about nvidia proprietary drivers.
  • x11/nvidia-driver is the base components.
  • x11/linux-nvidia-libs is the sets of libraries to support Linux apps running on linuxulator.
  • graphics/nvidia-drm-[510|515|61]-kmod is the additional components to support DRM. Only this one require LinuxKPI.
Although distfile of x11/nvidia-driver includes codes for graphics/nvidia-drm-[510|515|61]-kmod, it does not build it. This is because graphics/nvidia-drm-[510|515|61]-kmod requires codes from corresponding codes from distfiles of graphics/drm-[510|515|61]-kmod, which nvidia doesn't has copyright for it.
 
It works (alternative method) :

Code:
[mario@marietto /home/marietto/Desktop/Files/14.1-PassT/vmmko_dir]==> sfk replace -bin /bb6268797641bf6520626841b879766520/bb4b564d4b41bf564d4b5641b84d000000/ -dir "/home/marietto/Desktop/Files/14.1-PassT/vmmko_dir" -file vmm.ko -yes


[total hits/matching patterns/non-matching patterns]
[001/1/0] /home/marietto/Desktop/Files/14.1-PassT/vmmko_dir/vmm.ko          
1 files checked, 1 changed.
 
they spend 0 because they are reusing already written code
See the link I sent earlier: it's not cheap to release official Vulkan (and OpenGL) drivers. And even if there was no development specifically to FreeBSD (which there is), it would still cost money to pay staff for building/testing drivers. I will continue to counter your (un?)intentional misleading statements because otherwise they'll be quoted on Reddit or some Linux forum to "prove" something.
Can you give me 3 reasons why I should be grateful to nVidia ? I mean,for me it's not enough to say "they make the drivers for us and that's it" ; I would like to know why,a so big company like nVidia,that don't do nothing for nothing,offers to the FreeBSD users the drivers for their GPU,for an operatyng system that claims to be "the power to serve(r)" ; and in the server area there is no need to use the graphical part,the OS can be enterely used from the command line,while nVidia is the leader of the games and the desktop / home user market segment". In addition,Nvidia didn't offer to us neither the support for CUDA,maybe because they don't think that this OS is relevant in the Artificial Intelligence Computing area,also. Very thanks.
I'm reading this as: "FreeBSD is a server OS thus there's no reason for a GPU company to support it. There must be some insidious reason they do." LOL. Feel free to hate on the one and only GPU company that effectively delivers FreeBSD drivers (and has done for over 20 years) if you want, that's your choice. NVIDIA has chosen to do this for us, (grateful and other :)) FreeBSD desktop users.
Also, CUDA can be used, although that is using a workaround and not officially supported. Yes, things can always be improved and it would be great to have native CUDA support on FreeBSD.

But all in all: you're here hating because the (Windows) driver doesn't detect bhyve as a virtualization platform and there is something special in Windows 11 (!) that requires a workaround in the GPU driver. You might be better off hating on Microsoft and Windows 11, which is where the issue is located. A graphics driver shouldn't have to detect a hypervisor in order to work on a VT-d'ed PCI device.

Nonetheless: requesting NVIDIA to apply the same hack/workaround while running on bhyve would have costed you less time than trying to make up reasons to hate NVIDIA and actually have improved the world a tiny bit. Or you can try to convince Microsoft to fix Windows 11, which isn't going to happen but would be the most correct.
 
I don't hate anyone. I follow the logic of efficiency. I use what I like and what helps me to solve a problem. For this reason I use Linux and Windows (not so much,but I do),not only FreeBSD.

I think that big companies are there to maximize earnings in their area of interest. For different areas,they don't spend money and sometimes they could create problems for the competitors. Since nVidia is offering drivers for the users of FreeBSD for free and spending some money that they could save and because this is not the core of their business,I would like to know why they do. I can be grateful to nVidia if I do agree with their reasons.

I prefer to be grateful to shkhln , the developer who made possible to run CUDA on FreeBSD.
 
The idea of disassemble / do the reverse engineering of the module was mine from the beginning. I think that I have a very good intuition / nose,but,ahime',"some" theoretical gaps :D
 
Since nVidia is offering drivers for the users of FreeBSD for free and spending some money that they could save and because this is not the core of their business,I would like to know why they do.
x11/nvidia-driver was, at past, faced with a threat of extinction.

When nvidia switched to the current form of their driver, called "unified driver" supporting multiple generations of GPU archs, they strongly needed some (maybe 2 or 3, if I recall correctly) KPIs to build it, which at the moment FreeBSD didn't have.
They stated that they're no longer possible to provide their drivers (except for already "legacy" ones at the moment) FreeBSD without missing KPIs.

Finally the requested KPIs were implemented on FreeBSD kernel and now latest (means, same version as Linux but not fully equivalent in some functionality including CUDA) drivers for FreeBSD are constantly released at the same time with Linux until now, even for BETA and NewFeature branches.

If I recall correctly, someone asked nvidia why recently (at the moment) FreeBSD drivers are not updated, the answer was as above.

Sorry, I've lost track of the evidences, so just my memories.
Can someone point it out?
 
Another thing to mention.
nvidia does NOT AT ALL supports main branch of FreeBSD, prohibiting to build on main with version checking conditional.
So why it is buildable and running on FreeBSD main (aka -Current)?
It's because x11/nvidia-driver port patches (with reinplace in its Makefile, if I recall correctly, line 169 to 172) to kill version check for main branch to mimic current main branch as latest stable branch, and providing needed patches/reinplaces by FreeBSD project side. Upstream (nvidia) usually incorporates the fixes when they notice that new stable branch, which they would newly support, is created and x11/nvidia-driver port needs fixing not to attempt to apply already-upstreamed fixes.
 
x11/nvidia-driver was, at past, faced with a threat of extinction.

When nvidia switched to the current form of their driver, called "unified driver" supporting multiple generations of GPU archs, they strongly needed some (maybe 2 or 3, if I recall correctly) KPIs to build it, which at the moment FreeBSD didn't have.
They stated that they're no longer possible to provide their drivers (except for already "legacy" ones at the moment) FreeBSD without missing KPIs.

Finally the requested KPIs were implemented on FreeBSD kernel and now latest (means, same version as Linux but not fully equivalent in some functionality including CUDA) drivers for FreeBSD are constantly released at the same time with Linux until now, even for BETA and NewFeature branches.

If I recall correctly, someone asked nvidia why recently (at the moment) FreeBSD drivers are not updated, the answer was as above.

Sorry, I've lost track of the evidences, so just my memories.
Can someone point it out?

Ok. But what's the earning that nVidia has by releasing the drivers for FreeBSD ?
 
Back
Top