€•U5Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ0/translations/zh_CN/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/zh_TW/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/it_IT/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ja_JP/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ko_KR/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/pt_BR/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/sp_SP/gpu/amdgpu/process-isolation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒtarget”“”)”}”(hŒ.. _amdgpu-process-isolation:”h]”h}”(h]”Œamdgpu-process-isolation”ah ]”h"]”Œamdgpu-process-isolation”ah$]”h&]”uh1hµh´Khhh²hh³ŒJ/var/lib/git/docbuild/linux/Documentation/gpu/amdgpu/process-isolation.rst”ubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hhÆsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hÄhhh²hh³hÃh´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒAMDGPU Process Isolation”h]”hŒAMDGPU Process Isolation”…””}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÃh´KubhŒ paragraph”“”)”}”(hXôThe AMDGPU driver includes a feature that enables automatic process isolation on the graphics engine. This feature serializes access to the graphics engine and adds a cleaner shader which clears the Local Data Store (LDS) and General Purpose Registers (GPRs) between jobs. All processes using the GPU, including both graphics and compute workloads, are serialized when this feature is enabled. On GPUs that support partitionable graphics engines, this feature can be enabled on a per-partition basis.”h]”hXôThe AMDGPU driver includes a feature that enables automatic process isolation on the graphics engine. This feature serializes access to the graphics engine and adds a cleaner shader which clears the Local Data Store (LDS) and General Purpose Registers (GPRs) between jobs. All processes using the GPU, including both graphics and compute workloads, are serialized when this feature is enabled. On GPUs that support partitionable graphics engines, this feature can be enabled on a per-partition basis.”…””}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´KhhØh²hubhì)”}”(hŒýIn addition, there is an interface to manually run the cleaner shader when the use of the GPU is complete. This may be preferable in some use cases, such as a single-user system where the login manager triggers the cleaner shader when the user logs out.”h]”hŒýIn addition, there is an interface to manually run the cleaner shader when the use of the GPU is complete. This may be preferable in some use cases, such as a single-user system where the login manager triggers the cleaner shader when the user logs out.”…””}”(hhûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´K hhØh²hubh×)”}”(hhh]”(hÜ)”}”(hŒProcess Isolation”h]”hŒProcess Isolation”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj h²hh³hÃh´K ubhì)”}”(hŒ­The `run_cleaner_shader` and `enforce_isolation` sysfs interfaces allow users to manually execute the cleaner shader and control the process isolation feature, respectively.”h]”(hŒThe ”…””}”(hjh²hh³Nh´NubhŒtitle_reference”“”)”}”(hŒ`run_cleaner_shader`”h]”hŒrun_cleaner_shader”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjubhŒ and ”…””}”(hjh²hh³Nh´Nubj#)”}”(hŒ`enforce_isolation`”h]”hŒenforce_isolation”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjubhŒ} sysfs interfaces allow users to manually execute the cleaner shader and control the process isolation feature, respectively.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´Khj h²hubh×)”}”(hhh]”(hÜ)”}”(hŒPartition Handling”h]”hŒPartition Handling”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjNh²hh³hÃh´Kubhì)”}”(hXâThe `enforce_isolation` file in sysfs can be used to enable process isolation and automatic shader cleanup between processes. On GPUs that support graphics engine partitioning, this can be enabled per partition. The partition and its current setting (0 disabled, 1 enabled) can be read from sysfs. On GPUs that do not support graphics engine partitioning, only a single partition will be present. Writing 1 to the partition position enables enforce isolation, writing 0 disables it.”h]”(hŒThe ”…””}”(hj_h²hh³Nh´Nubj#)”}”(hŒ`enforce_isolation`”h]”hŒenforce_isolation”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj_ubhXË file in sysfs can be used to enable process isolation and automatic shader cleanup between processes. On GPUs that support graphics engine partitioning, this can be enabled per partition. The partition and its current setting (0 disabled, 1 enabled) can be read from sysfs. On GPUs that do not support graphics engine partitioning, only a single partition will be present. Writing 1 to the partition position enables enforce isolation, writing 0 disables it.”…””}”(hj_h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´KhjNh²hubhì)”}”(hŒHExample of enabling enforce isolation on a GPU with multiple partitions:”h]”hŒHExample of enabling enforce isolation on a GPU with multiple partitions:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´KhjNh²hubhŒ literal_block”“”)”}”(hŒz$ echo 1 0 1 0 > /sys/class/drm/card0/device/enforce_isolation $ cat /sys/class/drm/card0/device/enforce_isolation 1 0 1 0”h]”hŒz$ echo 1 0 1 0 > /sys/class/drm/card0/device/enforce_isolation $ cat /sys/class/drm/card0/device/enforce_isolation 1 0 1 0”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÔhÕŒforce”‰Œlanguage”Œconsole”Œhighlight_args”}”uh1jh³hÃh´KhjNh²hubhì)”}”(hŒ€The output indicates that enforce isolation is enabled on zeroth and second partition and disabled on first and third partition.”h]”hŒ€The output indicates that enforce isolation is enabled on zeroth and second partition and disabled on first and third partition.”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´KhjNh²hubhì)”}”(hŒlFor devices with a single partition or those that do not support partitions, there will be only one element:”h]”hŒlFor devices with a single partition or those that do not support partitions, there will be only one element:”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´K hjNh²hubjŽ)”}”(hŒn$ echo 1 > /sys/class/drm/card0/device/enforce_isolation $ cat /sys/class/drm/card0/device/enforce_isolation 1”h]”hŒn$ echo 1 > /sys/class/drm/card0/device/enforce_isolation $ cat /sys/class/drm/card0/device/enforce_isolation 1”…””}”hj¾sbah}”(h]”h ]”h"]”h$]”h&]”hÔhÕj‰jžŒconsole”j }”uh1jh³hÃh´K"hjNh²hubeh}”(h]”Œpartition-handling”ah ]”h"]”Œpartition handling”ah$]”h&]”uh1hÖhj h²hh³hÃh´Kubeh}”(h]”Œprocess-isolation”ah ]”h"]”Œprocess isolation”ah$]”h&]”uh1hÖhhØh²hh³hÃh´K ubh×)”}”(hhh]”(hÜ)”}”(hŒCleaner Shader Execution”h]”hŒCleaner Shader Execution”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjÞh²hh³hÃh´K)ubhì)”}”(hXThe driver can trigger a cleaner shader to clean up the LDS and GPR state on the graphics engine. When process isolation is enabled, this happens automatically between processes. In addition, there is a sysfs file to manually trigger cleaner shader execution.”h]”hXThe driver can trigger a cleaner shader to clean up the LDS and GPR state on the graphics engine. When process isolation is enabled, this happens automatically between processes. In addition, there is a sysfs file to manually trigger cleaner shader execution.”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´K+hjÞh²hubhì)”}”(hŒjTo manually trigger the execution of the cleaner shader, write `0` to the `run_cleaner_shader` sysfs file:”h]”(hŒ?To manually trigger the execution of the cleaner shader, write ”…””}”(hjýh²hh³Nh´Nubj#)”}”(hŒ`0`”h]”hŒ0”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjýubhŒ to the ”…””}”(hjýh²hh³Nh´Nubj#)”}”(hŒ`run_cleaner_shader`”h]”hŒrun_cleaner_shader”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjýubhŒ sysfs file:”…””}”(hjýh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´K-hjÞh²hubjŽ)”}”(hŒ9$ echo 0 > /sys/class/drm/card0/device/run_cleaner_shader”h]”hŒ9$ echo 0 > /sys/class/drm/card0/device/run_cleaner_shader”…””}”hj/sbah}”(h]”h ]”h"]”h$]”h&]”hÔhÕj‰jžŒconsole”j }”uh1jh³hÃh´K/hjÞh²hubhì)”}”(hŒdFor multi-partition devices, you can specify the partition index when triggering the cleaner shader:”h]”hŒdFor multi-partition devices, you can specify the partition index when triggering the cleaner shader:”…””}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´K3hjÞh²hubjŽ)”}”(hX$ echo 0 > /sys/class/drm/card0/device/run_cleaner_shader # For partition 0 $ echo 1 > /sys/class/drm/card0/device/run_cleaner_shader # For partition 1 $ echo 2 > /sys/class/drm/card0/device/run_cleaner_shader # For partition 2 # ... and so on for each partition”h]”hX$ echo 0 > /sys/class/drm/card0/device/run_cleaner_shader # For partition 0 $ echo 1 > /sys/class/drm/card0/device/run_cleaner_shader # For partition 1 $ echo 2 > /sys/class/drm/card0/device/run_cleaner_shader # For partition 2 # ... and so on for each partition”…””}”hjMsbah}”(h]”h ]”h"]”h$]”h&]”hÔhÕj‰jžŒconsole”j }”uh1jh³hÃh´K5hjÞh²hubhì)”}”(hŒuThis command initiates the cleaner shader, which will run and complete before any new tasks are scheduled on the GPU.”h]”hŒuThis command initiates the cleaner shader, which will run and complete before any new tasks are scheduled on the GPU.”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÃh´KHyperlink target "amdgpu-process-isolation" is not referenced.”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhjubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÃŒline”Kuh1jubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.