[CMake] CUDA Support

Luis Caro Campos julius.caro at gmail.com
Sat Mar 30 08:45:07 EDT 2019


I believe the closest equivalent to settinga CUDA_TOOLKIT_ROOT_DIR when
using enable_language(CUDA) is to set either the environment variable
CUDACXX or the CMake cache entry CMAKE_CUDA_COMPILER to point to the
location of the nvcc compiler.

However I think there are still some "features" of FindCUDA that
enable_language don't support, e.g. variables and/or import targets with
locations, see https://gitlab.kitware.com/cmake/cmake/issues/17816

Kind regards,
Luis

On Fri, Mar 29, 2019 at 4:57 PM Dustyn Blasig <dustyn at blasig.us> wrote:

> "we should not try to combine enable_language(CUDA) with
> find_package(CUDA). They do not work together, either use one or another."
>
> Absolutely, my goal is to move to the new built-in language support. I'm
> having trouble doing that because I can't find any documentation on it. For
> instance, what is the new equivalent CUDA_TOOLKIT_ROOT_DIR? Without
> find_package(CUDA), I don't see anything set that have the equivalent.
> Also, in some cases the CUDA include directory is added to targets, and in
> other cases it isn't, even if the target depends on source with .cu. What
> is the documented behavior for this?
>
> I'm sure there has to be a page somewhere on this, but going to page 4 on
> Google search didn't uncover anything, and the first 2 pages all point to
> various versions of FindCUDA : )
>
> On Fri, Mar 29, 2019 at 11:28 AM Dmitry Mikushin <
> dmitry at parallel-computing.pro> wrote:
>
>> Hi,
>>
>> That was my confusion as well: to my understanding, we should not try to
>> combine enable_language(CUDA) with find_package(CUDA). They do not work
>> together, either use one or another.
>>
>> Kind regards,
>> - Dmitry.
>>
>> пт, 29 мар. 2019 г. в 19:58, Dustyn Blasig <dustyn at blasig.us>:
>>
>>> Hi All,
>>>
>>> I can't find any documentation on the new-ish "native" CUDA support. I
>>> need to know all the variables that we can use, and (for instance) whether
>>> checking the CUDA version is now supported. When searching online, I'm
>>> always directed to the old FindCUDA pages which don't seem to match what is
>>> available with the native language support.
>>>
>>> Currently, I'm "hacking" my way through things by using both flows. I
>>> add CUDA as a language, use the found CUDA compiler to construct a
>>> CUDA_TOOLKIT_ROOT_DIR and then call find_package(CUDA) to get the old
>>> environment variables set up.
>>>
>>> Cheers!
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> https://cmake.org/mailman/listinfo/cmake
>>>
>> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190330/7a673fd6/attachment-0001.html>


More information about the CMake mailing list