vscode-clangd icon indicating copy to clipboard operation
vscode-clangd copied to clipboard

Help! Anyone know how to configure clangd.arguments or any other way to support CUDA intellisense

Open Aklice-new opened this issue 2 years ago • 6 comments

Does anyone know how to use vscode-clangd to support *.cu files, I search many blogs about it, I've try to create .clangd file in the root directory of the project or add "--cuda" in to clangd.arguments, but neither worked. So does anyone know how to do that? I'll be very grateful.

Aklice-new avatar Sep 17 '23 05:09 Aklice-new

You might find some helpful tips in https://github.com/clangd/vscode-clangd/issues/125

HighCommander4 avatar Sep 17 '23 05:09 HighCommander4

You might find some helpful tips in #125

Thanks you for reply, I have tried to add .clangd file into the project like below : ├── 3rd ├── build ├── .clangd ├── .clang-format ├── CMakeLists.txt ├── config ├── include ├── main.cpp ├── src └── .vscode and the .clangd file is : CompileFlags: Add: - -std=c++14 - --cuda-path=/usr/local/cuda/bin/ - --cuda-gpu-arch=sm_89 - -LC:/usr/local/cuda/lib64 - -IC:/usr/local/cuda/include

But when I want to jump to the header file, it still cant work

2023-09-17 13-55-20 的屏幕截图

Aklice-new avatar Sep 17 '23 05:09 Aklice-new

--cuda-path=/usr/local/cuda/bin/ ... -LC:/usr/local/cuda/lib64

That doesn't look right. /usr/local/cuda/bin/ is a Unix path. C:/usr/local/cuda/lib64 is a Windows path. What OS are you on?

HighCommander4 avatar Sep 17 '23 06:09 HighCommander4

--cuda-path=/usr/local/cuda/bin/ ... -LC:/usr/local/cuda/lib64

That doesn't look right. /usr/local/cuda/bin/ is a Unix path. C:/usr/local/cuda/lib64 is a Windows path. What OS are you on?

I’m on Ubuntu , Unix

Aklice-new avatar Sep 18 '23 11:09 Aklice-new

I’m on Ubuntu , Unix

Ok, so C: should definitely not appear in the paths present in the compile flags.

HighCommander4 avatar Sep 19 '23 00:09 HighCommander4

Seems llvm only partially support to 11.8 so far. I guess this is an upstream problem. Use cpptools and nsight extension instead?

levihuayuzhang avatar Jan 11 '24 14:01 levihuayuzhang