I've been trying to address the following issue in clangd for Visual Studio Code trying to access CUDA:
This patch alone is not yet sufficient for a fully functional clangd, but it gets rid of the error message saying
Cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.
in case clangd and the code is located on the C: drive.
In my case I had both clangd (which I needed for debugging purposes) and the source code on D:. At this point:
Candidates.emplace_back(D.SysRoot + "/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" + Ver);
the D.SysRoot seems to be empty. Then, during the call to
if (InstallPath.empty() || !FS.exists(InstallPath))
after sys::fs::make_absolute(WD->Resolved, Storage); (in VirtualFileSystem.cpp) the Storage expands to D:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4 which isn't found either.