AMD Implementing Process Isolation Support For Their GPU/Accelerator Driver

Written by Michael Larabel in Radeon on 15 August 2024 at 06:20 AM EDT. 5 Comments
RADEON
A set of patches posted today on the AMD graphics driver mailing list begin implementing support for process isolation within the AMDGPU kernel graphics driver.

AMDGPU driver maintainer Alex Deucher posted a set of patches beginning to add infrastructure to their open-source driver for process isolation, which is particularly important for multi-user environments or presumably the main motivation for adding it now is better supporting multi-user cloud environments with the AMD Instinct accelerators.

AMDGPU process isolation


Deucher explains of the AMDGPU Process Isolation:
"This patch set enables process isolation mode which serializes access to the graphics block between processes. When this mode is active, a cleaner shader is run between processes to clear shader LDS (Local Data Store) and GPRs (General Purpose Registers). A sysfs interface is also available to manually clear LDS and GPRs if you for example want to clear LDS and GPRs when a user logs out.

This includes support for GFX 9.4.3 and 9.4.4. Support for other GPUs is in progress and will be available when ready."

With initially targeting GFX 9.4.3 / GFX 9.4.4 hardware reaffirms the process isolation focus on the Instinct accelerators. But as mentioned with time other AMD GPUs/accelerators will also be able to benefit from this process isolation support.

With this code the cleaner shader is used by the command processor (CP) firmware for cleaning the LDS and GPRs between processes on the compute units. With these patches the new "enforce_isolation" setting is per-GPU and per-partition for greater control over its behavior. A "enforce_isolation" sysfs attribute is also added for easily toggling this feature on a per-GPU basis. The "enforce_isolation" sysfs attribute can also be read for knowing a given GPU's isolation status.

The new patches also add a "run_cleaner_shader" sysfs file that can be used for manually triggering the cleaner shader to run as desired. This can be done by Linux administrators or more than likely in a scripted/automated environment for clearing the GPU memory as deemed necessary and helping to prevent data leakage between different processes.

It's also argued in the process isolation patches that the cleaner shader can help enhance performance:
"The cleaner shader feature helps improve GPU performance and resource utilization by cleaning up GPU resources after they are used. It also enhances security and reliability by preventing data leaks between workloads."

Those interested in this AMDGPU process isolation functionality can find the initial code on amd-gfx.
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