Advanced Micro Devices Selects CMake to Make Improvements to AMD Radeon™ Software
Advanced Micro Devices, Inc. (AMD) focuses on modern computing, offering leadership high-performance and adaptive processor technologies. AMD combines CPUs, GPUs, FPGAs, Adaptive SoCs, and deep software expertise to enable leadership computing platforms for cloud, edge, and end devices.
AMD Software: Adrenalin Edition is what makes DirectX®, Vulkan®, and OpenGL® operate on Radeon™ GPUs. The modern 3D GPU driver stack is immense. Whenever an issue is submitted to a driver engineer at AMD, they must troubleshoot to discover where the bug is within the driver stack. Considering the complexity of modern GPUs and APIs, expertise in debugging is a must-have.
The AMD Software: Adrenalin Edition stack has existed since AMD’s ATI days. The codebase is immense with a long history. It also has its own build system. Dealing with a proprietary build system is a huge burden. One of the biggest strains was the Vulkan driver, which forced developers to maintain a build system for internal and open-source releases. This resulted in duplicated efforts, bloated CI time, made onboarding painful, and produced hard-to-find bugs. Consequently, AMD made the decision to fully convert the DirectX and Khronos UMDs (User Mode Drivers) to CMake.
AMD Software: Adrenalin Edition Built on CMake
New projects at AMD are written in CMake by default. CMake is the de facto build system for C/C++. You can reasonably expect engineers to already know it before coming to your company, saving you valuable resources. Its flexibility to generate both Ninja and Visual Studio solutions made it an obvious favorite for Windows developers, both locally and for CI, where Ninja is an easy choice. CMake also makes sharing code with customers exceedingly easy. Both of which are core parts of AMD’s business and philosophy. So, AMD recognized the power of CMake for a long time and was excited for the opportunity to convert the DirectX and Khronos UMDs.
A significant improvement to the developer’s workflow was the CMake ability to generate Ninja, Visual Studio, Makefiles, etc. Letting you choose based on your environment or circumstances the tool that best fits the job. Another huge benefit was working with IntelliSense in Visual Studio solutions. Lots of projects were just manually managing Visual Studio solutions. This was impossible to work with and was easily the biggest quality of life improvement CMake provided. This also allows users who want to work with Visual Studio, Vim, VsCode, and CLion to utilize the tools they are comfortable with.
By switching to CMake, AMD can quickly deliver new platforms to its customers. Anyone familiar with Windows 11 may know about WSA (Windows Subsystem for Android). Suddenly, the DirectX® 12 UMD had to support Android. Had AMD not switched to CMake, our DX12 driver would have been much slower to make our deliverable and incurred a tremendous technical debt. It shows even software like DirectX drivers need to be ready for cross-platform development.
Favorite CMake Feature
One of the most important tools CMake provides to users is toolchain files. They provided AMD with the exact mechanisms it needed to be compatible with the old build system. That is not even mentioning the high quality of life features that result from CMake and Visual Studio. Another critical feature of CMake is its ability to generate code and provide custom build targets. Multiple projects across the software stack use this feature to reduce code duplication, improve workflows, and implement features not otherwise possible. While there is always room for improvement it’s amazing how powerful this tool already is, this description is not even close to doing it justice.
AMD highly recommends working with Kitware. If your organization needs help moving to CMake, it’s the obvious choice. During the transition, AMD realized the power and flexibility of CMake. AMD wants to thank the CMake developers and community for their contribution to making this project a success. The CPPCON talks, blog posts, and quality documentation are just icing on the cake. AMD would also like to thank Caixa Jiang, Rodney Andre, and Allen Gallotta at AMD for seeing the cost-saving benefits of switching to CMake. Not all companies/managers would have allowed this work due to not seeing a direct profit. However, AMD transitioned due to an emphasis on cost savings, risk mitigation, and improving workflows.
Hopefully, in the future, all of AMD Software: Adrenalin Edition will be built using CMake. The groundwork has been laid down, and there is a desire for it. But change is hard. Drivers need to be constantly shipping, you need to compromise, you need to teach developers, you can’t break CI, you can’t break compatibility, etc. But it is worth it. This isn’t just a technical quality of life feature; CMake helps your business.