Skip to content
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

Fix for nvrtc issues on Ubuntu 20.04 and newer CUDA releases #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mandar2812
Copy link

This might also possibly address related issues like #11

With newer Ubuntu versions like 20.04 installing the cuda packages via apt sends them to /lib/x86_64-linux-gnu.

@korjaa
Copy link

korjaa commented Dec 8, 2020

I was able to fix my Ubuntu 20.04 compilation with the following diff:

diff --git a/libethash-cuda/CMakeLists.txt b/libethash-cuda/CMakeLists.txt
index 438fa8134..c26d84222 100644
--- a/libethash-cuda/CMakeLists.txt
+++ b/libethash-cuda/CMakeLists.txt
@@ -49,10 +49,7 @@ file(GLOB headers CUDAMiner.h CUDAMiner_cuda.h ${CMAKE_CURRENT_BINARY_DIR}/CUDAM
 
 cuda_add_library(ethash-cuda STATIC ${sources} ${headers})
 add_dependencies(ethash-cuda cuda_kernel)
-# Cmake doesn't handle nvrtc automatically
-find_library(CUDA_nvrtc_LIBRARY NAMES nvrtc PATHS ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES lib64 lib/x64 lib64/stubs lib/x64/stubs lib NO_DEFAULT_PATH)
-find_library(CUDA_cuda_LIBRARY NAMES cuda PATHS ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES lib64 lib/x64 lib64/stubs lib/x64/stubs lib NO_DEFAULT_PATH)
 target_link_libraries(ethash-cuda ethcore ethash::ethash progpow Boost::thread)
-target_link_libraries(ethash-cuda ${CUDA_nvrtc_LIBRARY} ${CUDA_cuda_LIBRARY})
+target_link_libraries(ethash-cuda nvrtc cuda)
 target_include_directories(ethash-cuda PUBLIC ${CUDA_INCLUDE_DIRS})
 target_include_directories(ethash-cuda PRIVATE .. ${CMAKE_CURRENT_BINARY_DIR})

But I guess it might break earlier builds that do need special handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants