The Open-Source AMD GPU Linux Kernel Graphics Driver Nears 5.8 Million Lines
([Radeon] 74 Minutes Ago
AMDGPU Line Count)
- Reference: 0001483307
- News link: https://www.phoronix.com/news/AMD-Kernel-GPU-5.8-Million
- Source link:
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
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