AMD Smart Access Memory / Resizable BAR On Linux Still Ripe For Improvement
Following Mesa 21.0 beginning to see AMD Smart Access Memory optimizations, I ran some benchmarks looking at the current state of S.A.M. / Resizable BAR support on Linux with Radeon graphics.
As has been outlined previously, the Linux kernel has actually supported resizable BAR for a while (or Smart Access Memory as referred to by AMD) while on the user-space driver side just this past week with Mesa 21.0 did we begin seeing the mentioned RadeonSI improvements. Details on verifying if Resizable BAR support is enabled on Linux can be found via this forum thread.
This week there's also been some separate Linux AMDGPU patches to improve BAR resizing but not yet found in any released kernel nor queued for 5.11. "This patch series improves the existing BAR resizing support in amdgpu. By default, it will attempt to resize BAR0 for each dGPU present to cover the VRAM, falling back to smaller sizes if necessary, e.g. if there's not enough address space remaining or support for the size is not advertised. Basic boot-time (or module load time) options to control this resizing are implemented: one to control whether resizing is done (and whether the advertised BAR sizes are ignored) and one to control the maximum BAR size (where the size would be increased). At present, these are coarse; they apply to all dGPUs driven by amdgpu."
With Mesa 21.0 after the RadeonSI patches landed and when using Linux 5.10-rc6 on the kernel side, I ran some quick benchmarks looking at the resizable BAR support on Linux with various OpenGL and Vulkan games. This was with the Ryzen 9 5950X running on the ASUS ROG CROSSHAIR VIII HERO WiFi motherboard where with the latest BIOS update makes it very prominent to toggle resizable BAR support.
For many OpenGL/Vulkan games on the few AMD Radeon graphics cards tested there was barely any performance difference at this time, but some uplift for a few Linux games:
Will be around with more benchmarks once the AMD Smart Access Memory support settles down with any further optimizations to come. If you have been trying it out on Linux, be sure to comment on this article in the forums with your experiences as it appears the AMD open-source developers are still looking for more testing/feedback.