Closed TaelinSu closed 8 months ago
When I use clangd as the LSP in VSCode to write cuda codes, clangd gives such errors:
Unknown argument: '-rdc=true'
Unknown argument: '-gencode'
Searching around for other CUDA issues suggests these flags need to be removed, which can be done using clangd's config file (https://github.com/clangd/clangd/issues/1907#issuecomment-1894800711).
GPU arch sm_35 is supported by CUDA versions between 7.0 and 11.8 (inclusive), but installation at /usr/local/cuda-12.1 is 12.1; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'
Have you tried adding one of the flags suggested in the error message?
When I use clangd as the LSP in VSCode to write cuda codes, clangd gives such errors:
Unknown argument: '-rdc=true'
Unknown argument: '-gencode'
Searching around for other CUDA issues suggests these flags need to be removed, which can be done using clangd's config file (#1907 (comment)).
GPU arch sm_35 is supported by CUDA versions between 7.0 and 11.8 (inclusive), but installation at /usr/local/cuda-12.1 is 12.1; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'
Have you tried adding one of the flags suggested in the error message?
Sure, I add and remove these flags using clangd's config file. The errors disappear.
This is my config.yaml:
CompileFlags:
Add: [--cuda-gpu-arch=sm_86]
Remove:
- -rdc=true
- -gencode
Thank you~
When I use clangd as the LSP in VSCode to write cuda codes, clangd gives such errors:
Unknown argument: '-rdc=true'
Unknown argument: '-gencode'
GPU arch sm_35 is supported by CUDA versions between 7.0 and 11.8 (inclusive), but installation at /usr/local/cuda-12.1 is 12.1; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'
My NVIDIA GPU is GeForce RTX 3070Ti, which compute capability is 8.6(sm_86).
The cuda project builds OK. This is
compile_commands.json
file in my project:I use xmake as my project build tools,
compile_commands.json
is generated automatically by xmake. This is myxmake.lua
:Logs
System information
Output of
clangd --version
:Editor/LSP plugin: VSCode/clangd
Operating system: Ubuntu-22.04 LTS in WSL 2(Windows 11)