GithubHelp home page GithubHelp logo

Cuda support about cmake HOT 8 OPEN

eyescale avatar eyescale commented on June 10, 2024
Cuda support

from cmake.

Comments (8)

jjcasmar avatar jjcasmar commented on June 10, 2024

BTW, this is the error im having
CMake Error at CMake/common/CommonCUDA.cmake:33 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
CMake/common/CommonFindPackage.cmake:276 (find_cuda_compatible_host_compiler)
CMakeLists.txt:103 (common_find_package_post)

CMake 3.9.4

from cmake.

hernando avatar hernando commented on June 10, 2024

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:

install(TARGETS your_target EXPORT ${PROJECT_NAME}Targets LIBRARY DESTINATION lib COMPONENT COMMON)

It may also solve your problem.

from cmake.

jjcasmar avatar jjcasmar commented on June 10, 2024

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?

from cmake.

hernando avatar hernando commented on June 10, 2024

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?

from cmake.

jjcasmar avatar jjcasmar commented on June 10, 2024

Cuda 9

from cmake.

hernando avatar hernando commented on June 10, 2024

I'll try to see the difference in the host_config.h header as soon as possible.

from cmake.

hernando avatar hernando commented on June 10, 2024

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?

from cmake.

jjcasmar avatar jjcasmar commented on June 10, 2024

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.

from cmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.