Skip to content

Commit 5618d07

Browse files
committed
Fix DEB10 wheel build
- Link amdsminic static library into libamd_smi_python.so to resolve undefined NIC symbols - Prevent pip-context wrapper from falling back to system libamd_smi.so to avoid dual-loading segfault - Add trailing newline to setup.cfg.in
1 parent 8f00256 commit 5618d07

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

projects/amdsmi/py-interface/amdsmi_wrapper.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,15 @@ def _build_candidate_paths():
243243
candidates = []
244244

245245
if context == "pip":
246-
# .so lives alongside the wrapper inside the wheel / site-packages
246+
# .so is self-contained inside the wheel / site-packages.
247+
# Do NOT fall back to the system libamd_smi.so: loading both libraries
248+
# in the same process causes segfaults during static initialisation of
249+
# std::variant tables on older toolchains (GCC 8 / glibc 2.28).
247250
candidates.append(base / "libamd_smi_python.so")
248-
else:
249-
# System package - .so lives under <rocm_root>/lib/
250-
candidates.append(base / "lib" / "libamd_smi.so")
251+
return candidates
252+
253+
# System package - .so lives under <rocm_root>/lib/
254+
candidates.append(base / "lib" / "libamd_smi.so")
251255

252256
# Fallbacks
253257
for env_var in ("ROCM_HOME", "ROCM_PATH"):

projects/amdsmi/py-interface/setup.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ include_package_data = True
1818
zip_safe = False
1919

2020
[options.package_data]
21-
* = *.so
21+
* = *.so

projects/amdsmi/src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,12 @@ if(BUILD_PYTHON_LIB)
156156
rt
157157
Threads::Threads
158158
${CMAKE_DL_LIBS}
159+
amdsminic
159160
${FILESYSTEM_LIB}
160161
)
162+
target_link_directories(${AMD_SMI}_python PRIVATE
163+
${CMAKE_CURRENT_BINARY_DIR}/nic/ai-nic/amdsmi_unified/build/
164+
)
161165
target_include_directories(${AMD_SMI}_python PRIVATE
162166
${CMAKE_CURRENT_SOURCE_DIR}
163167
${PROJECT_SOURCE_DIR}/rocm_smi/include

0 commit comments

Comments
 (0)