New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support clang as cuda compiler #455
Conversation
所以返回nil时预期行为还是说要修bug了? |
哪里的nil? |
刚拉的代码,mac下报错 $ xmake f --cu=clang++ -c
$ xmake
[ 50%]: ccache compiling.release src/main.cu
/usr/local/bin/ccache clang++ -c -Iinc -I/Developer/NVIDIA/CUDA-10.1/include -m64 -Qunused-arguments --cuda-path=/Developer/NVIDIA/CUDA-10.1 -o build/.objs/testc/macosx/x86_64/release/src/main.cu.o src/main.cu
error: clang: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. |
platform.tool 啊。。。 |
你试的哪一个?devlink那里还没整清楚,现在只有shared和console两个test能过 |
返回nil了就是没有找到对应tool,正常 |
刚随手测的自己建的console shared 都不行,等明天我再测下 |
tool有值,toolname没有。。。 |
你这版本不对吧,clang7只能支持cuda 7-9.2,8支持到10,要支持10.1你得自己编译个clang9啊 |
正常,platform.tool返回的 program, toolname 只确保 program路径肯定有值,toolname有可能是nil的,不是必须的 |
clang这也挺坑,支持CUDA支持一半,要devlink还要再把nvcc请出来。。。 这是说明真的没多少应用实际需要devlink? |
现在用devlink有哪些好处呢 还是说哪些场景必须要devlink? 看之前你贴的文档介绍,除了分离link,也没感觉出来有多少其他优势么。 现在用clang的话 cuda sdk还需要么 如果不需要的话,先默认不去用devlink好了 至少不需要再装nvcc 如果还是需要nvcc和cuda sdk环境,那这个切到clang编译 跟-ccbin clang 感觉就没什么区别了吧 |
只有在包含跨编译单元的
肯定需要,区别是可以用c++17,devcode的优化也不一样 |
ec62bbf
to
9c8b83a
Compare
lua那个插件的行为改一下吧,我今天调试那个正则的时候都要被弄傻了 > string.match("$(env p)", "%$%(env%s%S+%)")
> "$(env p)"
> "$(env path)"
C:\Users\lzy\Documents\Source\xmake-io\xmake\xmake;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.3.0\;C:\Program Files\LLVM\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\lzy\Documents\Source\xmake io\xmake\xmake;C:\Android;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\6\;C:\Users\lzy\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Fiddler;C:\Users\lzy\AppData\Local\nvs\default;C:\Users\lzy\AppData\Local\nvs\;C:\Users\lzy\xmake 这里用print不太合适吧。。。 |
这个我回头改进下,你先暂时用 |
add path.splitenv
35d073a
to
026a8aa
Compare
我这里测试都没啥问题了(win上不行不过应该是clang的bug),你再试试 |
merge了,我这边暂时没空间再编译一份clang了。自带的clang只支持cuda9,等回头我再测测好了。 |
我改进过了 |
你看下你这边还有什么其他问题么。没有的话,我最近打算先打个tag了,其他特性改进放在2.2.8中处理 |
行 |
Ref: https://llvm.org/docs/CompileCudaWithLLVM.html