€•j4Œ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Œ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”…””}”(hhøhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhhõ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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ and ”…””}”(hjhžhhŸNh Nubj)”}”(hŒ`enforce_isolation`”h]”hŒenforce_isolation”…””}”(hj"hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ} 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 KhhõhžhubhÃ)”}”(hhh]”(hÈ)”}”(hŒPartition Handling”h]”hŒPartition Handling”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhj:hž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 ”…””}”(hjKhžhhŸNh Nubj)”}”(hŒ`enforce_isolation`”h]”hŒenforce_isolation”…””}”(hjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjKubhXË 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.”…””}”(hjKhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¯h Khj:hž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:”…””}”(hjkhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¯h Khj:hž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”…””}”hj{sbah}”(h]”h ]”h"]”h$]”h&]”hÀhÁŒforce”‰Œlanguage”Œconsole”Œhighlight_args”}”uh1jyhŸh¯h Khj:hž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 Khj:hž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 hj:hžhubjz)”}”(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Œ}”uh1jyhŸh¯h K"hj:hžhubeh}”(h]”Œpartition-handling”ah ]”h"]”Œpartition handling”ah$]”h&]”uh1hÂhhõ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”…””}”(hjñhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjé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&]”uh1jhjéubhŒ sysfs file:”…””}”(hjéhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¯h K-hjÊhžhubjz)”}”(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”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÀhÁj‰‰jŠŒconsole”jŒ}”uh1jyhŸ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žhubjz)”}”(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”…””}”hj9sbah}”(h]”h ]”h"]”h$]”h&]”hÀhÁj‰‰jŠŒconsole”jŒ}”uh1jyhŸ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.”…””}”(hjIhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¯h KHyperlink target "amdgpu-process-isolation" is not referenced.”…””}”hjósbah}”(h]”h ]”h"]”h$]”h&]”uh1h×hjðubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”h¯Œline”Kuh1jîubaŒ transformer”NŒ include_log”]”Œ decoration”Nhžhub.