TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

148 pointsby TangerineDreamover 1 year ago

17 comments

somatover 1 year ago
The openbsd situation is even worse. over there the driver is bigger than the rest of the kernel.<p>Don&#x27;t get me wrong I use the driver every day and AMD is definitely one of the good guys for making an open source driver and them who ported it are absolute heros. However.... Sometimes I wish AMD had tied down the isa to their cards a little better. Narrowed the interface if you would. because as it is the driver is so big because there is this combinatorial explosion of generated header files.<p><a href="https:&#x2F;&#x2F;flak.tedunangst.com&#x2F;post&#x2F;watc" rel="nofollow noreferrer">https:&#x2F;&#x2F;flak.tedunangst.com&#x2F;post&#x2F;watc</a>
评论 #37341189 未加载
评论 #37341056 未加载
agloe_dreamsover 1 year ago
I&#x27;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.
评论 #37341586 未加载
评论 #37347333 未加载
评论 #37348080 未加载
评论 #37341955 未加载
tiffanyhover 1 year ago
As a comparison:<p><pre><code> FreeBSD: ~9M loc NetBSD: ~7M loc OpenBSD: ~3M loc </code></pre> And this <i>includes</i> the base userland (not just kernel)<p><a href="https:&#x2F;&#x2F;www.csoonline.com&#x2F;article&#x2F;564373&#x2F;is-the-bsd-os-dying-some-security-researchers-think-so.html&#x2F;amp&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.csoonline.com&#x2F;article&#x2F;564373&#x2F;is-the-bsd-os-dying...</a>
评论 #37342492 未加载
1-6over 1 year ago
&quot;Of course, much of that is auto-generated header files... A large portion of it with AMD continuing to introduce new auto-generated header files with each new generation&#x2F;version of a given block. These verbose header files has been AMD&#x27;s alternative to creating exhaustive public documentation on their GPUs that they were once known for.&quot;<p>So what&#x27;s the point of saying that it&#x27;s large?
评论 #37340667 未加载
评论 #37340359 未加载
userbinatorover 1 year ago
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&#x27;s GPUs, and looked into the Nouveau driver. Despite the fact that I already had a general idea of the command submission process and queues etc., following the codepath from the top-level &quot;copy this rectangle from here to there&quot; function down to the hardware registers felt ridiculously long-winded, although the ultimate actions were very very simple: write the command and its parameters to a circular queue, and tell the GPU to execute it by updating the queue registers.
评论 #37348339 未加载
guardiangodover 1 year ago
I am working on the kernel right now, the code is very pleasant (as far as C code goes) to work with.<p>Whereas I worked on Chrome&#x27;s V8 C++ code for a year and I still could not say I understand more than half of it. Its complexity is a factor more than the Linux kernel.
Kab1rover 1 year ago
I would much rather have a large amount of in-tree driver source over a small driver with a &quot;large&quot; firmware binary.
pixelesqueover 1 year ago
It&#x27;s not completely clear from the article, but: are the files generated &#x27;on-the-fly&#x27; during the build process (and therefore not in git), or generated once (by AMD), and then committed?
评论 #37341326 未加载
评论 #37341292 未加载
评论 #37340954 未加载
1letterunixnameover 1 year ago
Corporations don&#x27;t incentivize good engineering, they incentivize functionality at any cost. This leads to giant codebases, over-engineering, bad engineering, fragility, unmaintainable, useless code, and duplication. The FOSS&#x2F;FLOSS community must push back against the hot mess turds corporations want to dump into their source.
mrweaselover 1 year ago
So while the AMD driver is open source, the community is basically excluded from contributing?<p>Should someone decided that they&#x27;d start working through the code, removing duplicate code and clean up headers, functions and abstraction, they work would either be rejected, or undone with the next AMD code dump?
评论 #37341381 未加载
评论 #37345266 未加载
tgsovlerkhgselover 1 year ago
... and it doesn&#x27;t work right. When you start googling for your syslog entries you find countless reports spanning many kernel versions of identical looking crashes, likely with different root causes since all the message basically says is &quot;the GPU hung&quot;.
torginusover 1 year ago
Wouldn&#x27;t it be possible to move most of this code out of the kernel? I&#x27;m not sure what&#x27;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&#x2F;graphics display specific bits so you can display some basic graphics without the userland.
Osirisover 1 year ago
Why are GPU drivers baked into the kernel?<p>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?<p>Other operating systems load the GPUs drivers separately.
评论 #37344071 未加载
评论 #37351104 未加载
shmerlover 1 year ago
This could be expressed in binary format using way less space, but expressing it in code &#x2F; text I suppose make it more suitable to call it a source.
trevithickover 1 year ago
Does a graphical representation of the files in the Linux kernel exist anywhere? Like a graphical file explorer but for the different kernel components.
评论 #37341191 未加载
评论 #37343446 未加载
评论 #37341284 未加载
ameliusover 1 year ago
How much of it is generated code?
Thaxllover 1 year ago
Linux kernel is not made of 34M loc, most of it is drivers which I hardly consider kernel code.