€•}'Œ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”Œ#/translations/zh_CN/gpu/drm-compute”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/zh_TW/gpu/drm-compute”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/it_IT/gpu/drm-compute”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/ja_JP/gpu/drm-compute”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/ko_KR/gpu/drm-compute”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/sp_SP/gpu/drm-compute”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ"Long running workloads and compute”h]”hŒ"Long running workloads and compute”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ=/var/lib/git/docbuild/linux/Documentation/gpu/drm-compute.rst”h KubhŒ paragraph”“”)”}”(hŒýLong running workloads (compute) are workloads that will not complete in 10 seconds. (The time let the user wait before he reaches for the power button). This means that other techniques need to be used to manage those workloads, that cannot use fences.”h]”hŒýLong running workloads (compute) are workloads that will not complete in 10 seconds. (The time let the user wait before he reaches for the power button). This means that other techniques need to be used to manage those workloads, that cannot use fences.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒÄSome hardware may schedule compute jobs, and have no way to pre-empt them, or have their memory swapped out from them. Or they simply want their workload not to be preempted or swapped out at all.”h]”hŒÄSome hardware may schedule compute jobs, and have no way to pre-empt them, or have their memory swapped out from them. Or they simply want their workload not to be preempted or swapped out at all.”…””}”(hhÇhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hh£hžhubh¸)”}”(hŒLThis means that it differs from what is described in driver-api/dma-buf.rst.”h]”hŒLThis means that it differs from what is described in driver-api/dma-buf.rst.”…””}”(hhÕhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hX`As with normal compute jobs, dma-fence may not be used at all. In this case, not even to force preemption. The driver with is simply forced to unmap a BO from the long compute job's address space on unbind immediately, not even waiting for the workload to complete. Effectively this terminates the workload when there is no hardware support to recover.”h]”hXbAs with normal compute jobs, dma-fence may not be used at all. In this case, not even to force preemption. The driver with is simply forced to unmap a BO from the long compute job’s address space on unbind immediately, not even waiting for the workload to complete. Effectively this terminates the workload when there is no hardware support to recover.”…””}”(hhãhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒ²Since this is undesirable, there need to be mitigations to prevent a workload from being terminated. There are several possible approach, all with their advantages and drawbacks.”h]”hŒ²Since this is undesirable, there need to be mitigations to prevent a workload from being terminated. There are several possible approach, all with their advantages and drawbacks.”…””}”(hhñhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hXThe first approach you will likely try is to pin all buffers used by compute. This guarantees that the job will run uninterrupted, but also allows a very denial of service attack by pinning as much memory as possible, hogging the all GPU memory, and possibly a huge chunk of CPU memory.”h]”hXThe first approach you will likely try is to pin all buffers used by compute. This guarantees that the job will run uninterrupted, but also allows a very denial of service attack by pinning as much memory as possible, hogging the all GPU memory, and possibly a huge chunk of CPU memory.”…””}”(hhÿhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hXA second approach that will work slightly better on its own is adding an option not to evict when creating a new job (any kind). If all of userspace opts in to this flag, it would prevent cooperating userspace from forced terminating older compute jobs to start a new one.”h]”hXA second approach that will work slightly better on its own is adding an option not to evict when creating a new job (any kind). If all of userspace opts in to this flag, it would prevent cooperating userspace from forced terminating older compute jobs to start a new one.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒÝIf job preemption and recoverable pagefaults are not available, those are the only approaches possible. So even with those, you want a separate way of controlling resources. The standard kernel way of doing so is cgroups.”h]”hŒÝIf job preemption and recoverable pagefaults are not available, those are the only approaches possible. So even with those, you want a separate way of controlling resources. The standard kernel way of doing so is cgroups.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K$hh£hžhubh¸)”}”(hX4This creates a third option, using cgroups to prevent eviction. Both GPU and driver-allocated CPU memory would be accounted to the correct cgroup, and eviction would be made cgroup aware. This allows the GPU to be partitioned into cgroups, that will allow jobs to run next to each other without interference.”h]”hX4This creates a third option, using cgroups to prevent eviction. Both GPU and driver-allocated CPU memory would be accounted to the correct cgroup, and eviction would be made cgroup aware. This allows the GPU to be partitioned into cgroups, that will allow jobs to run next to each other without interference.”…””}”(hj)hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K(hh£hžhubh¸)”}”(hŒ¤The interface to the cgroup would be similar to the current CPU memory interface, with similar semantics for min/low/high/max, if eviction can be made cgroup aware.”h]”hŒ¤The interface to the cgroup would be similar to the current CPU memory interface, with similar semantics for min/low/high/max, if eviction can be made cgroup aware.”…””}”(hj7hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K.hh£hžhubh¸)”}”(hŒjWhat should be noted is that each memory region (tiled memory for example) should have its own accounting.”h]”hŒjWhat should be noted is that each memory region (tiled memory for example) should have its own accounting.”…””}”(hjEhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K2hh£hžhubh¸)”}”(hŒuThe key is set to the regionid set by the driver, for example "tile0". For the value of $card, we use drmGetUnique().”h]”hŒyThe key is set to the regionid set by the driver, for example “tile0â€. For the value of $card, we use drmGetUnique().”…””}”(hjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K5hh£hžhubeh}”(h]”Œ"long-running-workloads-and-compute”ah ]”h"]”Œ"long running workloads and compute”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jŒŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”jfjcsŒ nametypes”}”jf‰sh}”jch£sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.