Live data from Hacker News

Nvidia releases open-source GPU kernel modules

developer.nvidia.com

401–410 of 415 posts

Re: Nvidia releases open-source GPU kernel modules

#401
post #18

The kernel modules are the first stage I guess, since a massive amount of hardware programing knowledge is in user space like with AMD/intel GPUs. I wonder how much LAPSUS$ hack has to do with it. I wonder if nvidia hardware programing interface is a mess like AMD one, just curious.

Do you have a reference for the AMD interface? I know it exists but don't know where to find it.

If I recall properly, the command circular buffers of 2^n bytes ("queues" in vulkan3d) are VRAM IOMMAP-ed (you just need atomic R/W pointers for synchronization, see mathematically proven synchronization algorithms). There is a "GPU IRQ" circular buffer of 2^n bytes coupled with PCIE MSIs (and I recall something about a hardware "message box"). The "thing" is, for many of them, how to use those commands and how they are defined feels very weird (for instance the 3d/compute pipeline registers programing).

Have a look at libdrm from the mesa project (the AMDGPU submodule), then it will give you pointers where to look into the kernel-DRM via the right IOCTLs.

Basically, the kernel code is initialization, quirks detection and restoration (firmware blobs are failing hard here), setting up of the various vram virtual address spaces (16 on latest GPUs) and the various circular buffers. The 3D/compute pipeline programing is done from userspace via those circular buffers.

If I am not too much mistaken, on lastest GPU "everything" should be in 1 PCIE 64bits bar (thx to bar size reprograming).

The challenge for AMD is to make all that dead simple and clean while keeping the extreme performance (GPU is all about performance). Heard rumors about near 0-driver hardware (namely "rdy" at power up).

Re: Nvidia releases open-source GPU kernel modules

#402
post #381

Earlier quoted context omitted.

You mean, like Intel GPU drivers with just the libre free-as-in-freedom kernel and MESA? Blender? Krita? Cinelerra-CV? Darktable? ImageMagick? FFMPEG? KVM/Qemu? Most programming languages and frameworks? Clang/LLVM? WTF are you talking about? If any, science today it's made thanks to FLOSS software, propietary software it's the exception . And the trend it looking worse for propietary environments. Money will come fr…

Krita? You're just naming random open source Linux programs that hardly anyone uses. Yes, we can all make long lists of open source projects. That's not my point. The point is that the average person, on an average day, is using lots of proprietary software (or proprietary forks of open source software). I've been hearing about how the future of software is charging for support tickets and hand-waved 'integration' fo…

> Krita? You're just naming random open source Linux programs that hardly anyone uses.

More than you think, and ditto with Blender.

Re: Nvidia releases open-source GPU kernel modules

#405
post #301

Earlier quoted context omitted.

That's a bit of a tired and somewhat misleading argument. Take a look into the kernel-firmware repo, and you will see a tremendous amount of binary firmware blobs. For example the Intel micro-code blobs are protected by ~7 layers deep of encryption, wifi drivers may have government regulatory issues with sharing firmwares in anything but binary form. So let's please drop the evil binary blob nonesense... The kernel d…

This small tirade of yours is arguing against a strawman. GP is likely referring to the userspace component of nvidia's driver, not the actual blob that gets loaded onto the gpu. If it is indeed true that you need to run proprietary userland code, then this open-source release is nothing but a way to circumvent the GPL issues that lead to nvidia's driver partially breaking in Linux 5.??. While not ideal, I like many…

> this open-source release is nothing but a way to circumvent the GPL issues

Talking about strawman arguments... that's a doozie!

Instead of ignoring your strawman, staying focused on the topic...I'm going to address this nonesense...

Firstly Nvidia is not in violation of the GPL. Secondly, nobody cares about GPL violations, most certainly not the mainline kernel community. They do not pursue blatant GPL violations, because litigation is not productive in terms of improving the kernel, but keep in mind Nvidia is not violating the GPL. Thirdly, user space libraries that interface with a kernel API are not violating the GPL. Folks are allowed to run proprietary software on Linux. Do I like that, no... I certainly don't love it. However, Nvidia running user space graphics libraries is not much different than Radeon drivers using Mesa in userspace, it's how graphics architectures work in 2022.

So it's kidna ironic you're arguing about something separate (straw-man), and even then that argument fails...

Now then, putting your tangent aside... The whole point here is to start with the kernel, and get the kernel wrapper driver that interfaces with the hardware's firmware binary interface open sourced. The whole point is to get the driver into mainline, someday... Once we have that, we can untangle the the spaghetti of graphics API libraries, perhaps even port them to Mesa. Nvidia most certainly uses an intermediary low-level graphics representation for their graphics cards, so they can support all the various graphics APi's, or what not... it's a very common pattern for graphics cards... one Radeon even fell into not long ago. So it's just a matter of time before we decode this stuff.

But you're not wrong in terms of Nvidia's overall stack being proprietary, at least for now. But that's not important, what's important is Nvidia users wont' have so much drama when their distro kernel upgrades, and they screen goes blank thanks to Nvidia's driver not being compatible with the changed kernel ABI, and the AKMOD not being able to handle it.

Re: Nvidia releases open-source GPU kernel modules

#406

Earlier quoted context omitted.

Do you have a reference for the AMD interface? I know it exists but don't know where to find it.

If I recall properly, the command circular buffers of 2^n bytes ("queues" in vulkan3d) are VRAM IOMMAP-ed (you just need atomic R/W pointers for synchronization, see mathematically proven synchronization algorithms). There is a "GPU IRQ" circular buffer of 2^n bytes coupled with PCIE MSIs (and I recall something about a hardware "message box"). The "thing" is, for many of them, how to use those commands and how they…

> Have a look at libdrm from the mesa project (the AMDGPU submodule), then it will give you pointers where to look into the kernel-DRM via the right IOCTLs.

Exactly the pointer I was looking for, thank you.

Re: Nvidia releases open-source GPU kernel modules

#407

Earlier quoted context omitted.

As a Navi 10 (5700 XT) owner, those problems still exist. It used to be that at least once a week while gaming the driver would crash with some undecipherable error message in dmesg, and because the card had the reset bug the only recourse was to reboot the machine entirely. 4 years later the only thing that's changed is that the crash shows up less frequently (I'd say once every 3 months).

Have you ruled out power supply issues and are you running at stock clocks (for CPU and RAM as well)? Anyway, going from "at least once a week" to "once every 3 months" means that 90% of your crashes have been fixed. > with some undecipherable error message in dmesg What kind of message would you expect that would be more decipherable.

> Have you ruled out power supply issues and are you running at stock clocks (for CPU and RAM as well)?

Yes for both. No overclocking whatsoever.

> Anyway, going from "at least once a week" to "once every 3 months" means that 90% of your crashes have been fixed.

I don't think I'm supposed to be ok with a device I paid premium money for crashing once every three months with no explanation from the manufacturer. They could've fixed 99% for all I care, it's still absurd that it's even an issue in the first place.

> What kind of message would you expect that would be more decipherable.

One that would lead me to an actual solution or at least an explanation, not just year old threads of people reporting this exact issue with replies saying it was fixed in kernel version X, where X is different for each thread.

Re: Nvidia releases open-source GPU kernel modules

#408
post #238
post #53

1) This is unambiguously Good News 2) This is not upstreamable in its current form (nvidia admit this in their press release) 3) In an ideal world, nouveau (the open source driver for nvidia hardware) would be able to target this kernel code. Right now though there's no commitment for any sort of stable userland ABI, and that makes that difficult (moving to a new driver version may break interfaces that nouveau uses)…

Sadly, it's also not the actual GPU driver, just the kernel part; you still need their massive closed blob in userspace. Almost had me excited there for a moment.

It takes time for Nvidia to become open-source friendly. Still a good move.

Hopefully the GPU driver is next in their open-source roadmap.

Re: Nvidia releases open-source GPU kernel modules

#409
post #53

1) This is unambiguously Good News 2) This is not upstreamable in its current form (nvidia admit this in their press release) 3) In an ideal world, nouveau (the open source driver for nvidia hardware) would be able to target this kernel code. Right now though there's no commitment for any sort of stable userland ABI, and that makes that difficult (moving to a new driver version may break interfaces that nouveau uses)…

New code on github is never good news.

Why?

Re: Nvidia releases open-source GPU kernel modules

#410

Earlier quoted context omitted.

https://www.collabora.com/news-and-blog/blog/2022/03/23/how-... What is this effort?

It’s not actually a driver. Note comments like “Initialize driver-specific stuff” in the code. Mesa refers to https://docs.mesa3d.org/systems.html and Vulkan refers to https://en.m.wikipedia.org/wiki/Vulkan To quote the linked blog post: > This blog post will be a tutorial of sorts (we won't have a functioning Vulkan driver in the end, sorry) > First off, every driver needs a name. We're not actually writing one here…

The blog post is about writing a Vulkan driver inside Mesa. Nvidia's blob driver does not count here.
Post reply on HN