-
Notifications
You must be signed in to change notification settings - Fork 60
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
Replace use of FindCUDA with native CMake CUDA support. #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works for your use cases, I think its safe to transition. What is the minimum version of CMake this will require - 3.9 or 3.10? We should make a note in the docs about that.
How does this handle stuff that only needs the CUDA runtime library? |
@cyrush : I'm using 3.9.2 - have not tested with earlier versions. |
cmake/SetupCompilerOptions.cmake
Outdated
if (ENABLE_CUDA) | ||
enable_language(CUDA) | ||
# where to find nvcc | ||
if(CUDA_BIN_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove support for as many FindCUDA variables as possible. I would like this as close to normal CMake conventions as possible. This reduces the amount of upkeep we need to support going forward. This applies to CUDA_BIN_PATH, CUDA_HOST_COMPILER, and CUDA_NVCC_FLAGS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding CUDA_SEPARABLE_COMPILATION - I think it's best practice to do this in general, I don't think there is harm to doing separable compilation but it's certainly a pitfall folks can encounter. Should I just do that by default for the sake of killing the CUDA_SEPARABLE_COMPILATION flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think users can easily control globally withCMAKE_CUDA_SEPARABLE_COMPILATION
-- we don't have any per-target options for separable compilation exposed in the macro sig -- so I think you can at least pull it out from this macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to verify that we still have the "cuda_runtime" dependency working
The existing CUDA examples will need to be switched as well as documentation updated. I can help with any of that if you would like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @robinson96.
Have you tested this update against blt's cuda examples? Please ensure that the cuda-based tests and examples pass under this PR, and update the host-config for ray as necessary (in the host-configs
directory).
Note: The old host-config for ray was broken the last time I checked (see #146).
@davidbeckingsale : we are still using the CMAKE built in FindCUDA to set all the libraries and paths necessary for the cuda_runtime target. I've verified that that behavior is reasonable. |
That’s fine with me. Is everyone okay with the require CMake version getting bumped up?
|
rzmanta32{probinso}24: make test 100% tests passed, 0 tests failed out of 7 Total Test time (real) = 1.31 sec |
@davidbeckingsale and @robinson96 you may want to check with @ajkunen about CMake versions. I recall him telling me that he had issues with some later versions. |
@rhornung67 thanks for the warning, that rings with what I fear. |
@cyrush my purpose is to ring your fears.... |
I was having linking issues when using cmake 3.9.2, and had to back out to an early version.
I haven’t tried to figure out why… nor do I have the time. It may be that we’re doing something stupid.
…-Adam
From: Cyrus Harrison <notifications@github.com>
Reply-To: LLNL/blt <reply@reply.github.com>
Date: Wednesday, May 16, 2018 at 1:10 PM
To: LLNL/blt <blt@noreply.github.com>
Cc: Adam Kunen <kunen1@llnl.gov>, Mention <mention@noreply.github.com>
Subject: Re: [LLNL/blt] Replace use of FindCUDA with native CMake CUDA support. (#154)
@rhornung67<https://github.com/rhornung67> thanks for the warning, that rings with what I fear.
I am hoping we can stick with 3.9.x.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#154 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ARGiBO-QXibL842f8HSm2y4pDzjYTdZoks5tzIeQgaJpZM4T_7Y->.
|
Hmm, I'm sure you were doing something stupid 😄 did you ever try with a version > 3.9.2? |
Nope
…-Adam
From: David Beckingsale <notifications@github.com>
Reply-To: LLNL/blt <reply@reply.github.com>
Date: Wednesday, May 16, 2018 at 3:13 PM
To: LLNL/blt <blt@noreply.github.com>
Cc: Adam Kunen <kunen1@llnl.gov>, Mention <mention@noreply.github.com>
Subject: Re: [LLNL/blt] Replace use of FindCUDA with native CMake CUDA support. (#154)
Hmm, I'm sure you were doing something stupid 😄 did you ever try with a version > 3.9.2?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#154 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ARGiBPwf_hefubRGxyYLAnkvB75k-sBOks5tzKRmgaJpZM4T_7Y->.
|
Thanks for fixing the host-configs @robinson96. |
FWIW: the surface test I ran under this stuff was using cmake 3.8. That doesn't exercise the LINK_WITH_NVCC stuff, but it does exercise the SEPARABLE_COMPILATION. |
Meant to be a drop in replacement for FindCUDA. The only change I had to do do my host-config was to drop an explicit definition of -std=c++, as the native CMake puts it in there the right way and nvcc complains if you define it twice.