Fix(critical): Add rsmi_init shim to satisfy PyTorch linker dependencies when SMI is disabled
This commit is contained in:
@@ -793,6 +793,12 @@ if(ENABLE_AMDSMI)
|
|||||||
else()
|
else()
|
||||||
list(APPEND SRC_FILES src/misc/rocm_smi_wrap.cc)
|
list(APPEND SRC_FILES src/misc/rocm_smi_wrap.cc)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
# When SMI is disabled, compile the shim to provide dummy symbols (rsmi_init)
|
||||||
|
# This satisfies external dependencies (like PyTorch) that expect SMI symbols
|
||||||
|
# to be present, preventing them from failing to load or trying to load
|
||||||
|
# the broken system library.
|
||||||
|
list(APPEND SRC_FILES src/misc/smi_shim.cc)
|
||||||
endif()
|
endif()
|
||||||
list(APPEND SRC_FILES ${SMI_SOURCES})
|
list(APPEND SRC_FILES ${SMI_SOURCES})
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
// Dummy implementation of rsmi_init to satisfy linker dependencies
|
||||||
|
// when the real ROCm SMI library is broken or causes Bus Errors (gfx1151).
|
||||||
|
// Returns 0 (RSMI_STATUS_SUCCESS).
|
||||||
|
int rsmi_init(uint64_t flags) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user