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

Update CMakeLists.txt to adapte new CUDA version #15

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ZhuYanzhen1
Copy link

When I use a newer CUDA(Currently use 12.1), cmake .. command reports an error as:

CMake Error at cpp_to_py/gpudp/CMakeLists.txt:22 (add_library):
  Target "dp" links to target "CUDA::curand" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?

Refer to CMake forum, Jim mentioned that find_package(CUDAToolkit REQUIRED) is obsolete. So this pr created to fit newer CUDA Toolkit. And is modified and tested on my platform:

+ Platform: Ubuntu 20.04.6 LTS on x86
+ Kernel: Linux 5.15.0-119-generic
+ Python: Python 3.11.9
+ GCC: 9.4.0
+ Pytorch: 2.3.1
+ NVIDIA Driver: 535.183.06
+ CUDA Toolkit: release 12.1, V12.1.66

@liulixinkerry
Copy link
Member

Thank you for the pull request!

I think this is probably due to your newer CMake version instead of the newer CUDA version.

I tried CMake 3.17 and CUDA 12.5, and the main branch works fine.

@ZhuYanzhen1
Copy link
Author

Thank you for the pull request!
I think this is probably due to your newer CMake version instead of the newer CUDA version.
I tried CMake 3.17 and CUDA 12.5, and the main branch works fine.

You're right, I'm using cmake version 3.25.0 and after checkout to cmake3.17 everything is ok

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.

2 participants