I'm trying to debug a test program with VS CODE, CMake in Ubuntu 20. I referred mainly to the CUDA debugger document: https://docs.nvidia.com/nsight-visual-studio-code-edition/cuda-debugger/index.html. However, I'm not sure about how to write a correct launch.json in a project based on CMake. Here is my CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
project(cudaDebug CXX CUDA)
find_package(CUDA REQUIRED)
add_executable(main main.cu)
Here is my launch.json generated by VS CODE
{
"version": "0.2.0",
"configurations": [
{
"name": "CUDA C++: Launch",
"type": "cuda-gdb",
"request": "launch",
"program": "main.cu"
},
{
"name": "CUDA C++: Attach",
"type": "cuda-gdb",
"request": "attach"
}
]
}
When I press F5 to start debugging, an error information poped up:
main.cu: 346262241346234211351202243344270252346226207344273266346210226347233256345275225.