Fix(critical): Add rsmi_init shim to satisfy PyTorch linker dependencies when SMI is disabled

This commit is contained in:
Donato Capitella
2026-02-01 12:10:13 +00:00
والد f4b6e5f450
کامیت aec38e7dde
2فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
@@ -793,6 +793,12 @@ if(ENABLE_AMDSMI)
else()
list(APPEND SRC_FILES src/misc/rocm_smi_wrap.cc)
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()
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;
}
}