Open-Source AMD OpenGL Driver Drops Support For Smart Access Memory / ReBAR
With today's Mesa 22.3.7 stable update, set for the next Mesa 23.0 point release, and in Mesa 23.1-devel Git the past few days is the removal of SAM/ReBAR support from the RadeonSI Gallium3D driver. AMD Smart Access Memory is designed to "harness the full potential of the graphics card memory" by making the entirety of the vRAM frame-buffer accessible to the CPU at once. AMD Smart Access Memory is just PCIe Resizable BAR (ReBAR) but branded for AMD Ryzen + AMD Radeon system combinations.
The performance benefits aren't necessarily working out in clear favor for the OpenGL driver and thus was decided to just remove the code. The support in RADV as the Mesa open-source Radeon Vulkan driver remains: this code change is just regarding the RadeonSI OpenGL driver.
The removal of AMD Smart Access Memory from this driver was attributed to "CPU access has large overhead."
The performance issue came up via this Mesa bug ticket over the game Hyperdimension Neptunia Re;Birth1 performing very slowly with AMD Ryzen processor and Radeon graphics.
The extremely low performance was attributed to AMD Smart Access Memory and when disabling the support in the BIOS, the performance improved or when running with environment variables to override the behavior. Going through this issue led well known AMD open-source Mesa developer Marek Olšák to decide on just ripping out the Smart Access Memory code from RadeonSI since it wasn't a focus and not properly tested. So rather than white/black-listing games based on if ReBAR/SAM support is helping or not, the code was just removed from this Gallium3D driver. Again, the SAM/ReBAR support does remain within the RADV Vulkan driver, which after all is more important for modern Linux gaming than OpenGL.
Update: Marek has commented in the forums with additional context around this change:
If you have a case where the radeonsi version of SAM improves performance, please let me know.
SAM isn't really removed. The behavior that's removed is an aggressive use of VRAM for everything when SAM is enabled in the BIOS, which has slower CPU access.
SAM is still used if an app specifically asks for VRAM and then demands full CPU access to it. The kernel handles that optimally if SAM is enabled in the BIOS.