AMD Implementing Process Isolation Support For Their GPU/Accelerator Driver
([Radeon] 6 Hours Ago
AMDGPU Process Isolation)
- Reference: 0001485767
- News link: https://www.phoronix.com/news/AMDGPU-Process-Isolation
- Source link:
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.
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 [1]amd-gfx .
[1] https://lists.freedesktop.org/archives/amd-gfx/2024-August/112521.html
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.
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 [1]amd-gfx .
[1] https://lists.freedesktop.org/archives/amd-gfx/2024-August/112521.html
EphemeralEft