Live data from Hacker News

AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

phoronix.com

71–77 of 77 posts

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#71

I'm not sure I get why the comparison to the Kernel is needed. GPUs are wildly complex. Rendering is wildly complex. Managing memory and data is complex. Managing connected hardware is complex. I am not sure why anyone would expect a GPU Driver to be small while also doing a billion things and playing games as well as mature gaming platforms.

This is specifically about the kernel driver part.

Most of the GPU software stack can reasonably be outside the kernel. There's no obvious reason why much of it would need to be in ring-0 where bugs cause OS crashes and security vulnerabilities.

> Meanwhile the open-source NVIDIA "Nouveau" driver is around 201k (21.7k blank lines, 24.3k lines of comments, and 155k lines of code). Or the Intel i915 DRM kernel graphics driver is around 381k lines via the same cloc judgment.

But without separate line counts of the generated data tables and actual human written code, we don't have the real line count numbers to compare.

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#72

I'm not sure I get why the comparison to the Kernel is needed. GPUs are wildly complex. Rendering is wildly complex. Managing memory and data is complex. Managing connected hardware is complex. I am not sure why anyone would expect a GPU Driver to be small while also doing a billion things and playing games as well as mature gaming platforms.

All of this is also true for modern CPUs, yet I don't need a driver to talk to CPUs because the ISA serves as the abstracted and standardized programming interface to the underlying CPU hardware. If GPU vendors wouldn't be so keen about protecting their "IP", GPUs could have gone that same path.

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#73

Autogenerated code aside, I find that the vast majority of programmers are simply incapable of writing concise and straightforward code. They instead appear to love complexity, creating tons more abstractions and indirections than necessary. Not too long ago I wanted to figure out how to use the basic 2D acceleration (blitter) feature on Nvidia's GPUs, and looked into the Nouveau driver. Despite the fact that I alrea…

Often straightforward code is full of repetition. Abstraction is usually brought up to reduce repetition, but it comes with its own problems

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#74
post #68
post #47

Earlier quoted context omitted.

Nouveau barely works iirc

That is a bit harsh.. Nouveau will bring up you're Linux desktop just fine and connect all your monitors. It will run OpenGL apps and light games. Last time I checked it could not boost the clock and push most chips to high performance mode. This is mostly 100% Nvidia's fault of not opening up the specs. Otherwise what nouveau has been able to reverse engineer is just amazing. The nouveau driver is so much less painf…

Unfortunately I had very negative experience with it. I have a laptop with an Nvidia secondary, GPU and had the repeat terrible experience of my computer locking up right on boot due to the broken Nouveau driver that shipped with the kernel. It'd have been fine to not even initialize the GPU, as I wasn't actually using it, which is what I ended up doing, disabling nouveau right from the Grub menu.

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#75
Wouldn't it be possible to move most of this code out of the kernel? I'm not sure what's in it, but my guess what you actually need to have in the kernel is buffer allocation, memory protection and command submission code, and some modesetting/graphics display specific bits so you can display some basic graphics without the userland.

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#76
post #57

Why are GPU drivers baked into the kernel? Wouldn’t it be better to load them in such a way that a crash in the GPU driver can be recovered from as opposed to crashing the whole system? Other operating systems load the GPUs drivers separately.

>as opposed to crashing the whole system

Depending on your definition of 'the whole system' this is not entirely true.

The AMD driver for example will reset the GPU and force a xorg restart: https://paste.debian.net/plain/1290344

Now this does mean all desktop applications don't close properly, so I restart the PC to a 100% sure stability is at 100%, it didn't cause a kernel panic like the GPU crash would do previously.

I've had this crash happen only twice in ~90 hours of play time.

GPU: 5700XT

Driver: Mesa 23.1.5

Re: AMD Open-Source GPU Kernel Driver Above 5M Lines, Entire Linux Kernel at 34.8M

#77
post #13

Earlier quoted context omitted.

I have not seen these scripts, but can confirm that AMD has a long history of such Perl scripts. Look at hipcc for a current, moderately frustrating, example of this. Also the last time I met one of the open source driver team in person he was, in fact, wearing a classic ATI red ATI t-shirt straight in from Markham. Much of that team is European now though from what I hear, and they’re generally a good bunch.

>ATI t-shirt straight in from Markham. Curious how much of AMD Radeon GPU development now is being done in Markham-Canada, as AFAIK, the modern Radeon architecture stems from ATI's acquisition of ArtX[1], a US-based spin-ff of SGI, which was responsible for the GPUs in the Nintendo GameCube, Wii and many other innovations like programable shaders, later found in ATI/AMD GPUs. >Much of that team is European now though…

They had Bitboys but sold them onto Qualcomm a while ago.
Post reply on HN