@fribbledom To save folks a click, here's the catch 😉

"Though as reported previously, much of the AMDGPU driver code base is so large because of auto-generated header files for GPU registers, etc. In fact, 1.79 million lines as of Linux 5.9 for AMDGPU is simply header files that are predominantly auto-generated. It's 366k lines of the 2.71 million lines of code that is actual C code."

@cincodenada @fribbledom Man those Radeon cards were such a pain in the ass to set up...

@cincodenada @fribbledom
And to save everybody a trip to the comments, none of that includes the OpenGL, Vulkan, OpenCL, or other code that lives in user space, and often does a lot of the work.

@cincodenada @fribbledom I wonder why they include auto-generated C code in the kernel sources instead of including whatever is needed (tools, data) to generate that code. If anyone wanted to make changes/fixes to the codebase, that would be where they'd need to start, wouldn't it?


If I understand this correctly (not all of?) the generator code is publicly available.


@fribbledom what's crazier is that most of *that* code is auto-generated header files

@fribbledom The big problem with this is that you can't compare lines of code across languages. There is also a mix of interpreted and compiled languages listed, so comparing object code sizes is also irrelevant.

One could find one of Capers Jones' books or papers with published average LOC per function point and do a (still flawed, but much more accurate) comparison of function points.


Agreed, I really don't read too much into this, it's just a fun number. Also most of it are actually generated C headers.

@fribbledom Whoa. I'd always thought they were the more efficient and easily setup graphics card driver for Linux.

@fribbledom imagine how much would be nVidia code if they actually open sourced their drivers!
But frankly, isn't it time the kernel was customized at install to drop all irrelevant code before install (ok ok I know it's not that simple/easy/quick but you get my point)


Yeah, and ideally they would use git submodules so Linus finally realizes how bad of a design idea that was 😂

(It's Monday morning, I just couldn't resist)

@fribbledom anyway, AMD is great (compared with nVidia or Intel at least imho) for your average non-gamer Linux user, and with the Ryzen all in one Intel slaying CPUs, what's not to like?!

1: props to AMD for providing this (I've got a Radeon in my Linux machine, and the driver has always worked nicely, at least in my case)
2: yeah, as we learn on reading the article, it's much less *actual* code
3: as any programmer nows, "lines" of code is a very fluctuating measure. you can split lines, play code-golf (or the inverse...) even within the same language. So lots of lines of code can mean either or both of very good legibility or lazy roundabout programming.

@fribbledom "In fact, 1.79 million lines as of Linux 5.9 for AMDGPU is simply header files that are predominantly auto-generated." - I guess a fair comparison is yet to be made.

@fribbledom I'm not sure what to make of it. Is it a good thing or a bad thing? Good because AMD folks are contirbuting a lot of code to make AMD work better with Linux. Bad because of the sheer number of lines of code.


I guess that's a good thing as long as they keep maintaining that code. How that code is auto-generated is a bit questionable, though.

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!