-
Notifications
You must be signed in to change notification settings - Fork 71
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
Cuda support #571
Comments
BTW, this is the error im having CMake 3.9.4 |
You don't need to use CommonCUDA explicitly, the necessary code gets invoked from common_find_package_post(). If you've observed that error just by adding common_find_package(CUDA), then the problem must be in the parsing of the host_config.h CUDA header, which keeps changing all the time. Related to the first problem, you should use cuda_add_library. Although I don't remember what's the actual explanation for it I added this to my CMakeLists.txt:
It may also solve your problem. |
The problem with cudacommon happens when doing common_find_package(CUDA). Isn't there an easy way to simply do common_library and that compiles it with cuda if cuda is enabled? Or what should be the correct process to configure a project with cuda with cmakecommon? |
Ideally, having a smart common_library that can handle CUDA libraries would be perfect. But nobody has the time time right now to implement and I'm afraid that is not that simple, as it requires embedding cuda_add_library and will require making a few assumptions about the user intentions. I think the problem is the header parsing as I said, so it should be easily fixable. Which CUDA version are you using? |
Cuda 9 |
I'll try to see the difference in the host_config.h header as soon as possible. |
Sorry for the delay, but I had to look into more urgent things and eventually forgot about this issue. If you're problem with the header parsing solved? |
Ive been able to workaround the problem adding common_find_package(CUDA) after common_find_package_post(). This bypass the checks done in _post() and everything seems to work fine. Not a production solution for CMakeCommon, but it works. |
Hi,
ive been using CMakeCommon for a while now, but ive not been able to compile any library which uses CUDA.
If I try to compile using cuda_add_library, CMakeCommon complains that the target is not exported, but if I try to compile using common_library, g++ is used and not nvcc.
I believe that I should modify CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to use nvcc and a compatible gcc compiler. I thought that was that CommonCUDA did, but it seems there is a bug in the string(REGEX REPLACE) command.
What should I do?
Thanks!
The text was updated successfully, but these errors were encountered: