Cuda Linux Clion Configuration

Because I spent close to a week trying to get a Cuda / Linux / Clion (Jetbrains) Environment working - I am sharing what worked (for me) - as it completely did not match the guides / documentation that I could find. It is not complete, and it is currently buggy - but it works!

  • I installed ALL my cuda toolkits / nvidia drivers BEFORE I installed Clion.

Drivers were:

  • I am currently not able to debug into the kernel warps - I use copious printf statements to develop.
  • Clion will debug the C side portion of the code. Somehow it is compiling even with printf being flagged in error.


A new project (once you make it you cannot move it)

CMakeLists are being written as:

This part I don’t even know how/why it works because there is zero reference to nvcc? But it is - and it’s compiling.

Current path was really important (note that /usr/loca/cuda is a alias to the 12.0 Cuda Toolkit)

My nvcc version:

My cuda toolkit version!

Mistakes that I made:

  • Setting toolchain to point to nvcc broke Clion. For some reason in the above setup it ‘works’
  • printf gets flagged but still compiles

I think there is quite a bit of development with their product and hopefully it will have tighter - stronger integration with Cuda.