I am unable to find if there is any problem with the below build command generated by catkin_make. Similar questions on forums say that there must be some problem with the syntax of the command generated by cmake. Could some one help me find it ?
My system arch is aarch64 (Nvidia TX1) and OS is ubuntu 16.04. The same code builds perfectly on my ubuntu PC.
- CMake automatically found and verified the C and CUDA compilers and generated a makefile project. Note that the argument -DCMAKECUDAFLAGS='-arch=sm30' passes -arch=sm30 to nvcc, telling it to target the Kepler architecture (SM30 or Compute Capability 3.0) GPU in my computer.
- Detecting Cuda Architecture required by CMake using NVCC Documentation. 12 MAR 2018. 3 mins read Recently on the ARVP team I was assigned with the task of building a cmake script that could detect if Cuda is installed and return the compute capability of the graphic card on the computer.
- Building & Testing libcu.nix Systems, Native Build/Test. The procedure is demonstrated for NVCC + GCC in C11 mode on a Debian-like Linux systems; the same basic steps are required on all other platforms.
- Hello, I am trying to use addcustomtarget and addcustomcommand to compile a.cu (CUDA source file) into a.cubin (CUDA binary file). I can't seem to get CMake to use nvcc.
The difference I can make out when comparing the build output from my PC is that the tx1 compile options have some lines with round brackets. Is that a problem?
You can see if CUDA is present by checking CMAKECUDACOMPILER (was missing until CMake 3.11). You can check variables like CMAKECUDACOMPILERID (for nvcc, this is 'NVIDIA', Clang was added in CMake 3.18). You can check the version with CMAKECUDACOMPILERVERSION.
May be insignificant, but I also get the below warning on tx1 and not on my pc(more)
Cmake Could Not Find Cuda
The parentheses and the whitespace around many of the options looks suspicious. You can try copying the whole line into a shell script and running it to verify that it produces the same error (you may need to add quotes around some things)
Once you have a shell script that reproduces the issue, you can try to modify it in various ways until it works. Once you know how to make this one line work, the challenge is simplified to figuring out how to make cmake do the same thing (which is still not that simple :P )
Thank you. I removed the parentheses from the command and then it executes without any error. So how do I ensure cmake generates a command without these brackets? I see that only the vtk command options seems to have this problem.
Cmake Nvcc Student
I don't know. Perhaps you can read the cmake files for finding Cuda and VTK and see where it gets those options, or do a recursive grep of your filesystem to see which file those options are coming from.