Change IPC implementation to use DMA Bufs

As the KFD IPC IOCTLs will not be upstreamed, change runtime
implementation to use DMA bufs.

DMA buf fds will be passed over abstract unix domain sockets.
The exporter spins a thread that creates a socket server.
The importer connects to the server to fetch the fd.

libDRM will be required to do a manual import and GPU map for
memory that is not already imported and mapped.

For now, use the legacy IPC implementation by default as a
follow on patch will disable the HSA_ENABLE_IPC_MODE_LEGACY
environment variable.

Change-Id: Ifd8469e9adfc81f8a1ea78d6010fb10b515ba1b4
This commit is contained in:
Jonathan Kim
2023-11-07 12:45:18 -05:00
parent 0e3f668e2c
commit 5dfebdbca9
3 changed files with 349 additions and 22 deletions
+6
View File
@@ -218,6 +218,9 @@ class Flag {
var = os::GetEnvVar("HSA_ENABLE_MWAITX");
enable_mwaitx_ = (var == "1") ? true : false;
var = os::GetEnvVar("HSA_ENABLE_IPC_MODE_LEGACY");
enable_ipc_mode_legacy_ = (var == "1") ? true : true; // Temporarily always enable
// Temporary environment variable to disable CPU affinity override
// Will either rename to HSA_OVERRIDE_CPU_AFFINITY later or remove completely.
var = os::GetEnvVar("HSA_OVERRIDE_CPU_AFFINITY_DEBUG");
@@ -320,6 +323,8 @@ class Flag {
SRAMECC_ENABLE sramecc_enable() const { return sramecc_enable_; }
bool enable_ipc_mode_legacy() const { return enable_ipc_mode_legacy_; }
private:
bool check_flat_scratch_;
bool enable_vm_fault_message_;
@@ -344,6 +349,7 @@ class Flag {
bool override_cpu_affinity_;
bool image_print_srd_;
bool enable_mwaitx_;
bool enable_ipc_mode_legacy_;
SDMA_OVERRIDE enable_sdma_;
SDMA_OVERRIDE enable_peer_sdma_;