rocr: Fix IPC DMA Buf fragment handling and enable for development

Discarding blocks for reallocation on IPC export for better memory
performance trigger memory violations with DMA BUF exports so bypass
this for now as application performance drops haven't been observed
with the bypass.

The raw fragment should be passed to the DMA Buf export call as well
since offsets will be implicitly applied in the Thunk/KFD for
export/import calls.

Also, use the agent information directly from the pointer
information so that the export call doesn't have to scan memory to find
this.  Pass the node ID in the handle so that the import call doesn't
have to make two thunk imports to fetch the node ID for GPU memory
imports.

Finally, allow the user to use DMA Buf IPC via
HSA_ENABLE_IPC_MODE_LEGACY=0 for developer testing as legacy mode will
be applied by default.

Change-Id: Ie8fe267f8768fa5df37126078406f7065f69ff4e
Šī revīzija ir iekļauta:
Jonathan Kim committed 2024-09-27 14:40:42 -04:00
1 vecāks d64e33520f
revīzija 32bb0764b7
3 files changed
+92 -104

No files matched your search

+1 -1
Parādīt failu
@@ -234,7 +234,7 @@ class Flag {
enable_mwaitx_ = (var == "1") ? true : false;
var = os::GetEnvVar("HSA_ENABLE_IPC_MODE_LEGACY");
enable_ipc_mode_legacy_ = (var == "1") ? true : true; // Disable DMA-buf implementation for now
enable_ipc_mode_legacy_ = (var == "0") ? false : true; // Legacy mode by default
if (os::IsEnvVarSet("HSA_PCS_MAX_DEVICE_BUFFER_SIZE")) {
var = os::GetEnvVar("HSA_PCS_MAX_DEVICE_BUFFER_SIZE");
char* end;