On CSCS systems (e.g. Piz Daint), there is no file
/proc/sys/kernel/yama/ptrace_scope
So attaching cuda-gdb to a running process with the Nsight VScode extension fails when trying to read this file. It can be fixed by first checking if it exists as in Comparing NVIDIA:master...lukasgd:piz_daint · NVIDIA/nsight-vscode-edition · GitHub.