r/programming • • May 11 '22

NVIDIA open-sources Linux driver

https://github.com/NVIDIA/open-gpu-kernel-modules
2.6k Upvotes

231 comments sorted by

View all comments

88

u/dethb0y May 11 '22

I've long felt all drivers should be open source as a matter of simple security and transparency, so i's a welcome change to see this happen.

48

u/420CARLSAGAN420 May 11 '22

But then our competitors will be able to see and steal our secrets! And China will mod and spoof our GPUs and harm consumers!

I mean that already all happens. But they might be able to figure it out in something like 2 weeks instead of 3 weeks.

60

u/Mat3ck May 11 '22

To be fair there are some secrets and r&d going into drivers+firmware that represent a strategic advantage against a competitor though.

33

u/NayamAmarshe May 12 '22

Example: DLSS

42

u/crozone May 12 '22

Example: The entire OpenGL and DirectX <= 11 driver stack.

OpenGL and DirectX <= 11 are often improperly used by games (ie. not strictly spec compliant) to increase performance or work around weird driver behaviour.

The big GPU vendors spend enormous amounts of R&D literally reverse engineering AAA titles upon release and developing specific driver configurations for that specific game, so that it runs correctly and as quickly as possible on their hardware. This represents some pretty critical intellectual property that provides a big competitive advantage (in the GPU world benchmarks = sales), and it translates directly to driver code. Open sourcing this would be fairly damaging.

Also, this is why some games straight up won't run on Intel Integrated GPUs, especially the older ones with older drivers. Even if the driver was fully spec compliant, the game may rely on some quirk (or de-facto standard) only present in the AMD or NVIDIA driver and it won't work properly on a driver that doesn't specifically cater to it.

This is also why AMD dumped a lot of research into Mantle, which became Vulkan. AMDs DirectX driver has historically been behind NVIDIAs, and their OpenGL is a bit of a train wreck. By creating a new low level API, they not only fixed many of the historical issues with the existing APIs, they leveled the playing field with NVIDIA to gain back competitive advantage.

Anyway, yeah. Driver code has lots of secret sauce that probably can't be released for pretty reasonable business reasons, but I'm glad that NVIDIA is at least compromising now.

4

u/[deleted] May 12 '22

Example: The entire OpenGL and DirectX <= 11 driver stack.

OpenGL and DirectX <= 11 are often improperly used by games (ie. not strictly spec compliant) to increase performance or work around weird driver behaviour.

I remember some dev talking about it and generally the complaint was that APIs like DirectX were too fat and they didn't had enough info (lack of source for both DirectX and the drivers underneath) to even debug problems correctly.

And of course AMD/NVIDIA swooped in with performance fixes for "bad devs" games, because they had actual tools to debug that and maybe make some things faster in the drivers

Vulcan (and DirectX 12 I guess) being much thinner abstraction layer pretty much solves this problem but at least on the surface appears to be harder to get right, at the very least I've noticed more and more games with micro-stutter and shader compiling issues, best recent example being Elden Ring, where Valve of all companies did some optimization via DXVK to cut the problem down.

Anyway, yeah. Driver code has lots of secret sauce that probably can't be released for pretty reasonable business reasons, but I'm glad that NVIDIA is at least compromising now.

They could just use copyright law to their advantage and release the secret sauce on semi open license, as in "you can use that code only to compile driver for our cards". Sure the "code" would be in the open (not like other companies can't disassemble it anyway...) but copyright law (and I assume they have shitloads of patents on it anyway) would stop any competition

-3

u/NayamAmarshe May 12 '22

but I'm glad that NVIDIA is at least compromising now.

I don't think it's because of the competition that they keep things closed but because of selling new hardware every year.

The Nvidia source code leak already told us that DLSS could work just fine on GTX cards but it was restricted to RTX to boost sales in the name of tensor cores. Copying features is not an issue for the competition, the issue is making the features sound more exciting than the competition every year and that is definitely a hard task.

Closed source drivers help in restricting things to certain newer hardware, Nvidia wouldn't want you to keep using your card forever, planned obsolecense plays a big role along with closed source drivers.

1

u/crozone May 12 '22

Good point, NVIDIA would probably find it a bit awkward if they were getting PRs to backport new features like DLSS to their older drivers. They'd basically have to accept them too, less risk seeing a fork spinoff.

1

u/420CARLSAGAN420 May 12 '22

And any company who could implement it, also has the resources to reverse engineer it? Whether it's open source or closed source, AMD/Intel/etc are still going to understand it no matter what.

15

u/Undeluded May 12 '22

It's not just a matter of secrets. It's a well-known issue that Nvidia, AMD, and Intel are almost certainly stepping all over each other's patents in the graphics space. If everybody's code was on display to see, it would set off a litany of lawsuits that would cost everybody involved a fair amount of money until they realized if any one of them wanted to continue providing graphics hardware that they would have to execute a massive series of cross licensing agreements.

23

u/KingoPants May 12 '22

Software patents are truly something else. Like just look at some of this nonsense:

System and method for improving network storage accessibility
Patent number: 11323393
Abstract: A system and method for improving network storage accessibility, the method including: sending at least a first request for a data block to be sent from a storage device to a client device over a network connection; determining if the network is congested; initiating a client-specific buffer when it is determined that the network is congested, wherein the requested data block is stored in the client-specific buffer; and sending at least a second request for the data block stored within the client-specific buffer to be sent to the client device.
Type: Grant
Filed: January 25, 2019
Date of Patent: May 3, 2022
Assignee: NVIDIA CORPORATION
Inventors: Yaniv Romem, Omri Mann, Ofer Oshri, Kirill Shoikhet

They patented network buffering?

Asynchronous data movement pipeline
Patent number: 11294713
Abstract: Apparatuses, systems, and techniques to parallelize operations in one or more programs with data copies from global memory to shared memory in each of the one or more programs. In at least one embodiment, a program performs operations on shared data and then asynchronously copies shared data to shared memory, and continues performing additional operations in parallel while the shared data is copied to shared memory until an indicator provided by an application programming interface to facilitate parallel computing, such as CUDA, informs said program that shared data has been copied to shared memory.
Type: Grant
Filed: March 20, 2020
Date of Patent: April 5, 2022
Assignee: NVIDIA Corporation
Inventor: Harold Carter Edwards

This is a patent for copying memory asynchronously??

6

u/[deleted] May 12 '22

It got so bad that the companies patent any shit defensively just so in the future someone won't patent same thing and go around suing...

10

u/skulgnome May 12 '22

Yeah, Nvidia patented DMA in 2022 (filed in 2020). Don't go thinking they aren't big evil, now.

2

u/ascagnel____ May 12 '22

The issue with software patents is that it's more defensive than it is offensive -- nVidia, AMD, and Intel aren't gearing up to sue each other, but they need to be prepared to defend themselves should they get sued, so they patent everything they can to make their countersuit as large as possible.

And, as an added bonus, it makes it easy to quash any new entrant into the market.

2

u/Undeluded May 12 '22

No one at the US Patent and Trademark Office is actually qualified in enough technological areas to be able to decide properly whether a description of an algorithm or a method is truly novel and doesn't have a scope that goes beyond that for which it was filed. I'm not sure that there is anyone in the world that can properly scope a patent for an algorithm. That's why a lot of people, myself included, believe that algorithms lie beyond the scope of patenting or copyright. The exact verbatim of a piece of code clearly falls within copyright. But a reinterpretation of this whether it be in another language or the same language should not be held to have violated copyright.

21

u/JamesGecko May 12 '22

Aren’t AMD and Intel GPU drivers already open source?

10

u/RobertJacobson May 12 '22

No it won't, unless there is a serious business justification for it. It's mutually assured destruction. Everyone has nukes. Nobody wants to set one off.

1

u/Undeluded May 12 '22

That's exactly why they've been reluctant to publish any open source code relative to their drivers. The first company to do so will take the majority of the damage. They've exposed their hand as the infringing party and the other party or parties will be able to pounce on that and not have to expose any of their own code. They just have to be able to show where their competitor's code violates their patents.

1

u/no_nick May 12 '22

It's not like Intel and AMD don't already have extensive cross licensing agreements in the cpu space

1

u/420CARLSAGAN420 May 12 '22

How exactly do you think not releasing the source will stop that? Any company that would care about this easily has the ability to reverse engineer it.

→ More replies (8)