Trying to compile a file is not supported in the VS Code natively. This can be a issue if you want to compile and debug (atleast the CPU part of the file as kernel debugging is not supported in VS Code at the moment). .cu The procedure to do that is fairly simple. In your project, hit . That will give the below pop-up. F5 On selecting , we'll get default options (assuming compilers and debuggers are available on path). C++(GDB/LLDB) Choose one of the option. I go for . This will create and . More information about the purpose of these files can be found g++-7 launch.json task.json here However at this point if you try to compile a file with this, that won't work as the default compiler chosen (if gcc) won't understand CUDA extensions. Thus open .cu task.json Change command to (assuming you have it on path). nvcc Post this try building and debugging a file with a break-point set. It should build successfully and you should be able to debug the CPU part of the code. cu