I am working on resolving a CMake issue to merge a module into CMake proper that will allow us all to use the various (and glorious) NVIDIA libraries in modern CMake, such as cuRAND and cuSOLVER etc. I have been able to scrap together working examples from the docs for almost every library (small bug with cufft_static but I can figure that one out), such that in your own projects you will be able to do
find_package(CUDALibs REQUIRED COMPONENTS ...) # ... target_link_libraries(myexe CUDA::cusolver) # or target_link_libraries(myexe CUDA::cusolver_static)
This is still in an early stage, but my aim is to have it ready by 3.13-rc1. I have not used the NPP library before, and do not have time to learn all of its glory. The main docs page lists what the various libraries are for: https://docs.nvidia.com/cuda/npp/index.html
But I do not understand how to create some small minimal working examples for each individual library. For example, calling functions exclusive to nppi. They can be very simple, but each of these need to be tested individually to make sure the packaging and dependencies are mapped correctly, both dynamically and statically.
The samples in the CUDA SDK are a little too convoluted / bring in way more extra code than is needed.
If you work on or work with NPP, please consider helping me get started in supporting this library with CMake. I believe that with this support will come increased usage, as currently you have to manually specify linking flags which is not ideal.
Note the current minimal working examples for all other libraries are pure C++ – no CUDA code – and should be able to compile and link against the libraries using just the API calls. Our goal is to make sure that we do not require enable_language(CUDA). This module will operate independently of CUDA as a language / FindCUDA.cmake, enabling non-CUDA applications to still use / link against these libraries.
Thank you in advance for any help / pointers / explanation (e.g., even if it’s just to say “NPP actually must be compiled in CUDA source files”). I look forward to getting support into CMake for all of these libraries!