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

Written by Michael Larabel in Radeon on 4 August 2024 at 10:47 AM EDT. 55 Comments
RADEON
Last August I wrote an article about 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 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.

AMD Radeon graphics cards


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.

AMDGPU cloc metrics


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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week