Modern AMD Graphics Driver Surpasses Six Million Lines Of Code In Linux 7.0
([Radeon] 2 Hours Ago
AMDGPU + AMDKFD Driver)
- Reference: 0001615437
- News link: https://www.phoronix.com/news/AMD-Six-Million-Lines-Linux-7.0
- Source link:
It was less than four years ago that [1]the modern AMDGPU/AMDKFD open-source driver stack was at four million lines of C code and header files. Now with the Linux 7.0 kernel it has surpassed six million lines. Or put another way, by the same calculations [2]Linux 7.0-rc1 is at 39.2 million with the modern AMD kernel graphics driver now making up 15% of the kernel's entire codebase as the single largest driver.
With the current Linux 6.19 stable kernel the drivers/gpu/drm/amd/ directory is at 5,937,130 lines comprised of 5,110,038 detected lines of code, another 618,113 lines of code comments, and 20,8979 blank lines in the code files. The drivers/gpu/drm/amd/ directory consists of both the AMDGPU kernel graphics driver as well as the AMDKFD kernel compute driver for both the Radeon/Instinct compute support used by the (not counted) ROCm user-space. It doesn't include the old classic Radeon legacy driver ( drivers/gpu/drm/radeon/ ) that is mainly used for pre-GCN hardware support.
With the just-closed Linux 7.0 merge window, drivers/gpu/drm/amd/ has broke the six million line threshold with the cloc utility reporting 6,048,151 detected lines of code between 5,202,309 lines of code, 631,591 lines of comments, and 214,251 blank lines. That six million lines is spread across 2,694 lines in total. This comes with [3]Linux 7.0 adding support for new/upcoming AMD graphics hardware .
Most of the excess in the AMDGPU/AMDKFD code-base, as previously covered, is due to the mass amounts of auto-generated header files for each GPU target. There are 4.4 million lines of header files for the modern AMD graphics driver as the majority of the codebase due to the auto-generated header files that are rather redundant and serve as a form of living documentation given AMD's lack of focus in more recent years of pushing out hardware programming documentation (besides the GPU ISA documentation) and focusing instead on improving the open-source Linux driver as the living reference implementation.
The modern AMD open-source graphics driver remains the single biggest in-tree driver of the Linux kernel. Linux 7.0-rc1 cloc'ed comes in at 29,591,268 lines of detected code, 4,697,951 lines of comments, and 4,950,659 blank lines in code files. Just some food for thought on the size of the Linux 7.0 kernel and the AMD driver.
[1] https://www.phoronix.com/news/AMDGPU-4-Million
[2] https://www.phoronix.com/news/Linux-7.0-rc1-Released
[3] https://www.phoronix.com/news/Linux-7.0-Graphics-Drivers
With the current Linux 6.19 stable kernel the drivers/gpu/drm/amd/ directory is at 5,937,130 lines comprised of 5,110,038 detected lines of code, another 618,113 lines of code comments, and 20,8979 blank lines in the code files. The drivers/gpu/drm/amd/ directory consists of both the AMDGPU kernel graphics driver as well as the AMDKFD kernel compute driver for both the Radeon/Instinct compute support used by the (not counted) ROCm user-space. It doesn't include the old classic Radeon legacy driver ( drivers/gpu/drm/radeon/ ) that is mainly used for pre-GCN hardware support.
With the just-closed Linux 7.0 merge window, drivers/gpu/drm/amd/ has broke the six million line threshold with the cloc utility reporting 6,048,151 detected lines of code between 5,202,309 lines of code, 631,591 lines of comments, and 214,251 blank lines. That six million lines is spread across 2,694 lines in total. This comes with [3]Linux 7.0 adding support for new/upcoming AMD graphics hardware .
Most of the excess in the AMDGPU/AMDKFD code-base, as previously covered, is due to the mass amounts of auto-generated header files for each GPU target. There are 4.4 million lines of header files for the modern AMD graphics driver as the majority of the codebase due to the auto-generated header files that are rather redundant and serve as a form of living documentation given AMD's lack of focus in more recent years of pushing out hardware programming documentation (besides the GPU ISA documentation) and focusing instead on improving the open-source Linux driver as the living reference implementation.
The modern AMD open-source graphics driver remains the single biggest in-tree driver of the Linux kernel. Linux 7.0-rc1 cloc'ed comes in at 29,591,268 lines of detected code, 4,697,951 lines of comments, and 4,950,659 blank lines in code files. Just some food for thought on the size of the Linux 7.0 kernel and the AMD driver.
[1] https://www.phoronix.com/news/AMDGPU-4-Million
[2] https://www.phoronix.com/news/Linux-7.0-rc1-Released
[3] https://www.phoronix.com/news/Linux-7.0-Graphics-Drivers