Ways to require CUDA arch minimum version?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Ways to require CUDA arch minimum version?

Hong Xu
Is there a way to enforce a minimum CUDA arch version when finding CUDA?
Hong

--

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
Reply | Threaded
Open this post in threaded view
|

Re: Ways to require CUDA arch minimum version?

Robert Maynard
Are you asking for a minimum CUDA SDK version or a restriction based
on the hardware of the machine?

We have no pre-built logic to enforce a minimum hardware component, as
we want to support building CUDA on a machine without a GPU.
As far as minimum CUDA SDK is concerned if you are doing it through
find_package(CUDA) you would check the version after and error out if
not high enough
As farm as CUDA as a first class language, you can check the
CMAKE_CUDA_COMPILER_VERSION and error out.

On Thu, Aug 15, 2019 at 9:34 PM Hong Xu <[hidden email]> wrote:

>
> Is there a way to enforce a minimum CUDA arch version when finding CUDA?
> Hong
>
> --
>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Ways to require CUDA arch minimum version?

Hong Xu
Thanks, I am interested in enforcing minimum computing capacity (which translates to hardware restraint). If there is no such feature, would you be interested for such a feature?
Hong

On August 16, 2019 7:41:33 AM PDT, Robert Maynard <[hidden email]> wrote:

>Are you asking for a minimum CUDA SDK version or a restriction based
>on the hardware of the machine?
>
>We have no pre-built logic to enforce a minimum hardware component, as
>we want to support building CUDA on a machine without a GPU.
>As far as minimum CUDA SDK is concerned if you are doing it through
>find_package(CUDA) you would check the version after and error out if
>not high enough
>As farm as CUDA as a first class language, you can check the
>CMAKE_CUDA_COMPILER_VERSION and error out.
>
>On Thu, Aug 15, 2019 at 9:34 PM Hong Xu <[hidden email]> wrote:
>>
>> Is there a way to enforce a minimum CUDA arch version when finding
>CUDA?
>> Hong
>>
>> --
>>
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Ways to require CUDA arch minimum version?

Mojca Miklavec-2
In reply to this post by Hong Xu
On Fri, 16 Aug 2019 at 03:34, Hong Xu wrote:
>
> Is there a way to enforce a minimum CUDA arch version when finding CUDA?
> Hong

I don't know if the following is the correct advice, but I use the
following code in my setup to enforce Pascal:

    string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_60,code=sm_60")

else my code would not compile once I started using some newer directives.
I believe that more archs would be needed in the string for better
support of newer architectures, but just to get the starting point.

I would have preferred if there was a better directive, similar to
    set(CMAKE_CXX_STANDARD 14)
that can enable either C++14 or C++17 or later (depending on other
components of the project) without actually harcoding c++14 and ending
up with "-std=c++14 -std=c++20" in flags. For example something along
the lines of
    set(CMAKE_CUDA_MIN_ARCH 60)

Mojca
--

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