0x002B - Cuda - Clion Setup [PASSING but why?]

Cuda - Clion Setup [PASSING but why?]

0x002B - Cuda - Clion Setup [PASSING but why?]

There is No Rhyme or Reason - why [this] setup works:

CLion is in default mode - normally you would set your debugger to point to cuda-gdb, and your compiler should point to the specialized nvcc.

No reference to nvcc at all - yet it could be presumed that CMake is doing the support and connecting to compile the following code block:

_ _ host _ _ is a cuda specific qualifier for the nvcc compiler.  Somehow this is compiling and working against all the documentation and guides they present. However for whatever this works (and there is stepping-debugging!) - once this works - document whatever you have because who knows what will break it.

gcc --version

cmake --version

cuda installed packages:

nvidia - installed packages:

Some installation notes:

  • The COMPLETE installation of cuda-12 / nvidia drivers was done before CLion was setup.
  • CMakeLists.txt is as follows on the test project:

Apparently nvcc does not work with C++ 17 - creating a project with C++ 14 would increase compatibility odds - but who even knows if that is true:

Current nvidia-smi:

Now imagine (somehow) in Jan 2022 I was able to get this partially working for the now obsolete K80 Compute Module in Linux with Clion - which has never been replicated since and the cards sit idle moving to a 3060ti for the headache of these drivers..  

More testing is required now in terms of _ _ device _ _ type testing to see if the warp scheduler can be called or not.

Errors soon emerge:

In the above code block malloc is being error - underlined - yet it compiles:

We are even able to step-debug (in a error-state!)

If a regular C file is created malloc is no longer improperly highlighted:

With the following CMakeLists

Some more notes on this:

  • Alias cuda was built in /usr/local that pointed to the cuda-12 - this was probably automatically found by CMake, where it is doing the actual work on behalf of CLion's configuration.
Linux Rocks Every Day