News: 0001483307

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

The Open-Source AMD GPU Linux Kernel Graphics Driver Nears 5.8 Million Lines

([Radeon] 74 Minutes Ago AMDGPU Line Count)


Last August I wrote an article about [1]the open-source AMD GPU kernel driver crossing 5 million lines of code -- including their overzealous header files -- and following the recent Linux 6.11 merge window curiosity got the best of me with how much larger the kernel driver is now that [2]the initial RDNA4 support is merged ... Well, it's about to cross 5.8 million lines, or about a 16% increase just over the past year.

Last year the drivers/gpu/amd kernel code amounted to 5.03 million lines between actual code, code comments, blank lines, and header files. Bulking up the AMDGPU driver a lot is all the auto-generated header files that AMD commits each time a new GPU is added for covering the registers and other GPU bits each time. A lot of those header files are rather redundant but at least automated.

[3]

When running cloc on the AMD kernel driver code that includes AMDGPU, AMDKFD, and related modern AMD kernel graphics driver support (not counting the old "Radeon" DRM driver), it's now up to... 5.798 million lines.

Around 16% growth over the past year with since then the RDNA3.5 and RDNA4 support being added along with many other additions to the AMD kernel graphics driver code. But again much of that weight is from the C header files. This also doesn't include all of the AMD user-space code like within Mesa, the AMDVLK driver, ROCm, etc.

The AMDGPU/AMDKFD kernel driver code for modern AMD Radeon/Instinct hardware remains the largest kernel driver within the kernel source tree. Running cloc on the Linux Git state as of this morning, the kernel is at around 37.1 million lines in total -- 28,004,898 lines of code detected, 4,467,874 comment lines detected, and 4,672,184. So from this loose metric, the modern AMD kernel graphics driver represents around 15.6% of the entire kernel codebase.



[1] https://www.phoronix.com/news/AMD-5-Million-Lines

[2] https://www.phoronix.com/news/Linux-6.11-AMDGPU-Final-RDNA4

[3] https://www.phoronix.com/image-viewer.php?id=2024&image=amd_radeon_cards_lrg



scottishduck

Counting in octal is just like counting in decimal--if you don't use your
thumbs.
-- Tom Lehrer