The modern AMD Kernel graphics driver consisting of AMDGPU, the AMDKFD compute code, and associated infrastructure continues to easily be the largest mainline open-source driver. With the Linux 6.16 kernel debuting as stable as soon as later today, the AMD kernel graphics driver cracks the 5.9 million line threshold. In comparison, the entire Linux kernel source tree comes in at
The Linux 6.16 Git state as of today has the drivers/gpu/drm/amd area above 5.9 million lines. That comes from around 5.08 million lines of code, 613k lines of code comments, and 204k blank lines, as measured by the cloc utility. Though as long noted, the AMDGPU driver is particularly heavy due to having so many auto-generated header files for each GPU generation/target… Of the 5+ million lines of code, around 4.4 million lines are detected as C header files by cloc. But still even 666k lines of code not counting blank lines or comments alone still puts it as one of the biggest upstream open-source Linux kernel drivers on its own.
In comparison, the AMD kernel graphics driver in Linux v6.15 came in at 5,897,360 lines total compared to 5,904,055 lines where it is at today.
The AMD kernel graphics driver is only getting bigger each release too.. For the current state in DRM-Next today ahead of the Linux v6.17 merge window, the AMD kernel graphics driver size comes in at 5,907,326, or an increase of just 3k lines of code for the next kernel given no major new GPU hardware enablement for that next cycle.
For those wondering the overall size of the Linux 6.16 Git kernel ahead of its likely release later today, as measured by the same cloc utility it comes in at around 38,417,651 lines… That’s from 28.9 million lines of detected code, 4.58 million lines of code comments, and another 4.8 million blank lines.
Or the AMD kernel graphics driver accounting for roughly 15% of the Linux kernel source tree. Again, a lot of header files and the like and no real merit to the source code size itself, but some interesting metrics for those into numbers and the growing size of the Linux kernel source tree.
For some additional perspective, the Intel i915 and Xe kernel graphics drivers combined come in at 509k lines of code in Linux 6.16 with some 352k lines of detected code (48.5k lines of headers), 74k lines of comments, and 83k blank lines. Or the Nouveau open-source NVIDIA driver comes in at 224k lines.