Idea Raised For Reducing The Size Of The AMDGPU Driver With Its Massive Header Files

Written by Michael Larabel in Radeon on 16 September 2024 at 11:30 AM EDT. 48 Comments
RADEON
Following the weekend news of the AMDGPU kernel driver becoming too large that it's causing the Plymouth boot splash screen on slower Linux systems to time-out, longtime AMD Linux graphics driver engineer Marek Olšák expressed a new idea for helping to reduce some bloat from this AMD kernel graphics driver.

Much of the nearly six million lines of code making up the AMDGPU driver are auto-generated header files for each supported GPU. Most of them are unused by the driver itself and serve as a sort of living documentation around the GPUs with AMD focusing less in recent years on putting out hardware documentation publicly and focusing more on just enhancing the AMD open-source graphics driver.

Marek's proposed solution is rather straight-forward: move all the AMDGPU GPU header files out into its own separate dedicated repository. The AMDGPU driver can pull in just the header files actually needed and used by the driver. Other user-space software depending upon the header files like Mesa and the UMR debugger can fetch from that dedicated repository rather than from within the kernel source tree.

Marek also proposes a Python script that could trim all the header files and only keeping around the definitions actually used by the AMDGPU driver source code.

Radeon graphics cards


Marek notes in the AMD issue tracker that the size of the AMDGPU driver include directory for header files is roughly 32.7% the entire size of the Linux kernel source Git tree... And he warns that it's not going to stop growing with AMD continuing to work on new GPU support. Marek estimates that around 98% of the ASIC headers could be removed from the kernel source tree with his approach.

AMD Linux engineer Mario Limonciello also added on the FreeDesktop.org thread that the x86 CPUID expected output data documentation is going through a similar transition of moving to an external centralized database and then will periodically sync with the kernel source tree.

We'll see if this idea gains any traction for coming up with a dedicated, official repository where AMD graphics GPU/ASIC header files will live outside of the kernel tree and then trimming the fat within the AMDGPU kernel driver source folder.
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