mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #383] Build fails with nvshmem installed as RPM in /usr/lib64 — unable to create wheel #259
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#259
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vshawrh on GitHub (Aug 28, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/383
Description
When trying to build this package against
nvshmemprovided as an RPM (installed under/usr/lib64and/usr/include/nvshmem_${CUDA_MAJOR_VERSION}), the wheel build fails due to incorrect linking flags and library discovery issues.Currently, the
setup.pyassumes local paths like${nvshmem_dir}/liband${nvshmem_dir}/include. This breaks in RPM-based environments wherenvshmemis installed system-wide.Issues observed
Link flags not generic
extra_link_argsused explicit-l:libnvshmem_host.soand-l:libnvshmem_device.a.-lnvshmem_host,-lnvshmem_device).nvshmem_bootstrap_uid.sowas incorrectly linked, but not actually required.RPATH handling
${nvshmem_dir}/libwas added to-rpath./usr/lib64/nvshmem/${CUDA_MAJOR_VERSION}and/usr/lib64, requiring explicit rpath.Device linking
nvcc_dlinkwas missing system paths fornvshmem_device, causing unresolved references during device code linking.Wheel creation fails
nvshmem_hostandnvshmem_deviceproperly,pip wheel .fails to produce a wheel on systems wherenvshmemis installed as an RPM.libnvshmem_host.so.3and unresolved device symbols.Changes needed
Use system include and library directories:
Update linker flags to use sonames instead of filenames:
Update device linking with
nvcc:Expected outcome
nvshmemis installed from RPM..whl) can be created and installed in a clean environment.libnvshmem_host.so.3andlibnvshmem_devicedynamically without hardcoding filenames.@EmilienM commented on GitHub (Aug 29, 2025):
To make the build process more portable and user-configurable, I propose that we update
setup.pyto use environment variables for discovering NVSHMEM paths and linker flags.We could adopt an approach that prioritizes explicit environment variables, with a fallback mechanism for backward compatibility.
New Environment Variables:
Implement Fallback Logic:
Conditional Compilation:
The NVSHMEM extension should only be built if both NVSHMEM_INCLUDE_PATH and NVSHMEM_LIBRARY_PATH are successfully resolved (either directly or via the NVSHMEM_DIR fallback). This prevents build failures when NVSHMEM is not available or configured.
Note
I've done similar work in flashinfer-python:
github.com/flashinfer-ai/flashinfer@ce68e1d0cc@YidaWeng commented on GitHub (Oct 1, 2026):
V2.5 removed the NVSHMEM backend entirely (
READMEnews: "Fully remove V1, including its APIs, NVSHMEM backend, and legacy documentation. NVSHMEM is no longer a dependency").setup.pyon currentmainonly links NCCL (nolibnvshmem_*paths), so the RPM/usr/lib64discovery issue described here no longer applies. This issue looks safe to close as obsolete for V2.5+.