Lorenz Braun via llvm-dev
2016-Jun-07 09:21 UTC
[llvm-dev] NVPTX compilation problems - ptxas error
Hello everybody, i am currently testing the NVPTX back-end and playing around with the IR it generates. Unfortunately i have come to an compilation error i cannot solve on my own. Maybe someone reading this knows what is causing the trouble and has a possible solution. I am using Ubuntu 16.04, Cuda 7.5 and clang version 3.9.0 (https://github.com/llvm-mirror/clang.git 2869a420162946c5eecaa3742fc9c50a698d7a61) (https://github.com/llvm-mirror/llvm.git 56547528a22d290a2e8b2c40810abb8117a8a6bc) I have attached my source code which i try to compile with clang++ (it is just for testing so the code is not mean to do something useful) and here is the command i am using: $ clang++ --cuda-gpu-arch=sm_20 loops.cu -o loops-clang -L/opt/cuda-7.5/lib64 -lcudart_static -ldl -lrt -pthread ptxas /tmp/loops-36dc47.s, line 5; error : Unsupported .version 4.2; current version is '3.2' ptxas fatal : Ptx assembly aborted due to errors clang-3.9: error: ptxas command failed with exit code 255 (use -v to see invocation) Compilation with nvcc works by the way. I will be glad about any help and provide more information if needed. Kind regards Lorenz -------------- next part -------------- A non-text attachment was scrubbed... Name: loops.cu Type: application/cu-seeme Size: 3470 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160607/d05f59a2/attachment.cu>
Pranav Madhikar via llvm-dev
2016-Jun-30 10:56 UTC
[llvm-dev] NVPTX compilation problems - ptxas error
Hello Lorenz, I think I may have found what is causing the problem. I had the same problem and was able to solve it, see below. Do you have more than one version of cuda installed? I think however clang invokes the compilation of the cuda parts of the code may be causing the problem. It may be falling back onto an older version of cuda. In my case I had cuda-5.5 installed at /usr/local/cuda-5.5 with /usr/local/cuda linked to it. And I have cuda-7.5 installed elsewhere, that is the version in my $PATH and the one I was linking against during compilation. When I ran the compilation with the -v flag, I found that /usr/local/cuda/ptxas was being being invoked (cuda-5.5) instead of the version of ptxas (cuda-7.5) I had in my $PATH. That is the default location that cuda is normally installed to, clang may be defaulting to that. If you have root access, you might try installing cuda-7.5 to /usr/local/cuda. Doing that fixed it for me. I think this might be a bug in how cuda code is compiled. clang should respect what version you keep in your $PATH. Best Regards, Pranav
Madhur Amilkanthwar via llvm-dev
2016-Jun-30 14:36 UTC
[llvm-dev] NVPTX compilation problems - ptxas error
Yes as pranav pointed this issue is with your installation. Point to correct ptxas binary and it should just compile because the error clearly indicates that the generated ptx has newer version but binary is old. Try 'which ptxas', it may help. On Jun 30, 2016 4:26 PM, "Pranav Madhikar via llvm-dev" < llvm-dev at lists.llvm.org> wrote:> Hello Lorenz, > > I think I may have found what is causing the problem. I had the same > problem and was able to solve it, see below. > > Do you have more than one version of cuda installed? I think however clang > invokes the compilation of the cuda parts of the code may be causing the > problem. It may be falling back onto an older version of cuda. > > In my case I had cuda-5.5 installed at /usr/local/cuda-5.5 with > /usr/local/cuda linked to it. And I have cuda-7.5 installed elsewhere, that > is the version in my $PATH and the one I was linking against during > compilation. When I ran the compilation with the -v flag, I found that > /usr/local/cuda/ptxas was being being invoked (cuda-5.5) instead of the > version of ptxas (cuda-7.5) I had in my $PATH. That is the default location > that cuda is normally installed to, clang may be defaulting to that. If you > have root access, you might try installing cuda-7.5 to /usr/local/cuda. > Doing that fixed it for me. > > I think this might be a bug in how cuda code is compiled. clang should > respect what version you keep in your $PATH. > > Best Regards, > Pranav > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160630/0b75fd2c/attachment.html>
Lorenz Braun via llvm-dev
2016-Jul-05 15:27 UTC
[llvm-dev] NVPTX compilation problems - ptxas error
Sorry, after a few days. I was pretty busy so i have just read your answer. Indeed i have multiple cuda installations. I will check if that fixes the problem. Thank you very much! Am 30.06.2016 um 12:56 schrieb Pranav Madhikar via llvm-dev:> Hello Lorenz, > > I think I may have found what is causing the problem. I had the same > problem and was able to solve it, see below. > > Do you have more than one version of cuda installed? I think however > clang invokes the compilation of the cuda parts of the code may be > causing the problem. It may be falling back onto an older version of > cuda. > > In my case I had cuda-5.5 installed at /usr/local/cuda-5.5 with > /usr/local/cuda linked to it. And I have cuda-7.5 installed elsewhere, > that is the version in my $PATH and the one I was linking against > during compilation. When I ran the compilation with the -v flag, I > found that /usr/local/cuda/ptxas was being being invoked (cuda-5.5) > instead of the version of ptxas (cuda-7.5) I had in my $PATH. That is > the default location that cuda is normally installed to, clang may be > defaulting to that. If you have root access, you might try installing > cuda-7.5 to /usr/local/cuda. Doing that fixed it for me. > > I think this might be a bug in how cuda code is compiled. clang should > respect what version you keep in your $PATH. > > Best Regards, > Pranav > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Apparently Analagous Threads
- [LLVMdev] [NVPTX] For linkonce_odr NVPTX generates .weak, but even newest PTXAS can't handle it
- [LLVMdev] [NVPTX] For linkonce_odr NVPTX generates .weak, but even newest PTXAS can't handle it
- NVPTX compilation problems - ptxas error
- [LLVMdev] [NVPTX] PTXAS - Unimplemented feature: labels as initial values
- [LLVMdev] [NVPTX] PTXAS - Unimplemented feature: labels as initial values