-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking problem with host portion of CUDA kernels for CMake >= 3.15 #109
Comments
martinschwinzerl
added
bug
C++
cmake
cuda
Problems related to the CUDA architecture backend and/or technologies like pycuda, numba or cupy
labels
Nov 7, 2019
👍 😄 |
martinschwinzerl
added a commit
to martinschwinzerl/sixtracklib
that referenced
this issue
Oct 21, 2020
- The flag CUDA_RESOLVE_DEVICE_SYMBOLS should be enabled by default on shared libraries like SixTrackLib. The property does not work on OBJECT libraries like sixtrack_cuda_device. It seems that starting with cmake 3.15, cmake did not pick up the property for the resulting compound SHARED library just by inferring the dependency on the CUDA device part. This fix attempts to rectify this by adding the property explicitly to the SHARED sixtracklib library if the sixtrack_cuda_device target is present. Tested on CMake 3.14, 3.16 und 3.18 -> seems to work - Note: this would fix issue SixTrack#109 but more investigation is required whether this solves all problems encountered therein
martinschwinzerl
added a commit
to martinschwinzerl/sixtracklib
that referenced
this issue
Oct 22, 2020
Backported from #PR130 - The flag CUDA_RESOLVE_DEVICE_SYMBOLS should be enabled by default on shared libraries like SixTrackLib. The property does not work on OBJECT libraries like sixtrack_cuda_device. It seems that starting with cmake 3.15, cmake did not pick up the property for the resulting compound SHARED library just by inferring the dependency on the CUDA device part. This fix attempts to rectify this by adding the property explicitly to the SHARED sixtracklib library if the sixtrack_cuda_device target is present. Tested on CMake 3.14, 3.16 und 3.18 -> seems to work - Note: this would fix issue SixTrack#109 but more investigation is required whether this solves all problems encountered therein
Closing due to merge of PR #132 into the main branch, please re-open if the problem persists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that the mangled c++ symbols for the host side of cuda kernels are not exported by the shared library and causes problems during linking of applications (even non-cuda ones):
The same source code compiles and links successfully under cmake < 3.15. May have something to do with
LINKER_LANGUAGE=C
setting forsixtrack_cuda_device
andsixtrack_cuda_host
which always seemed a bit fishy to me.The text was updated successfully, but these errors were encountered: