CUDA complains about nvcc being an "unsupported toolchain" - cuda

I've made a 1D convolution program in CUDA - but for some reason the executable doesn't run as CUDA complains "the provided PTX was compiled with an unsupported toolchain" (this error is thrown on the first CUDA library function). My program was compiled with nvcc, with the command I used being exactly: nvcc program.cu -o program and the command I used to run the resultant executable: ./program.
Googling returns little to no results - any help?

tl;dr: NVIDIA driver too old for CUDA toolkit
The NVIDIA driver version in the Arch repos was out-of-date with the newest CUDA version in the same repos - (https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html, my system had CUDA version 11.2.0, but NVIDIA Driver version 455.x.x).
Downgrading the CUDA version solved the issue.

Related

CUDA on Ubuntu 16.04

I am installing CUDA from this link.
Though it is a CUDA SDK 9.2, when I check the version installed using nvcc --version, I get the following results:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17
I am new to CUDA and wanted to check if this is expected. Should I expect 9.2 as the CUDA version post installation?
FYI - GPU is GeForce GTX 1080 Ti
You need to follow the official guide step by step,click here to check if the toolkit is installed correctly. Also,the post-installation-actions must be taken into consideration,click here to get more info.
I had occured the same condition u mention above, In my case, I add this path to the PATH:
$ export PATH=/usr/local/cuda-9.2/bin${PATH:+:${PATH}}
The best solution should be to modify the corresponding profile file, like this:
vim /etc/profile
Add export PATH=/usr/local/cuda-9.2/bin${PATH:+:${PATH}} to the end of the file
reboot
Good Luck.

Maximum compute capability enabled for a CUDA toolkit version

How can I learn maximum compute capability of devices for which I can compile code with the compiler from a given version of CUDA toolkit?
Suppose, I have cuda6.5 toolkit. Is nvcc from there able to compile for GTX GeForce 970 (compute capability 5.2)?
One approach would be trial and error - launch test compile commands with the compute capabilities you want. If you get an error, that toolkit version does not support that compute capability:
$ nvcc -arch=sm_20 t10.cu -o t10
$ nvcc -arch=sm_52 t10.cu -o t10
nvcc fatal : Value 'sm_52' is not defined for option 'gpu-architecture'
$
Another approach would be to read the programming guide document that ships with each toolkit and is installed (e.g. on linux) in /usr/local/cuda/doc. Table 12 of that doc will list the available compute capabilities supported by that compiler version.
I'm sure there are other approaches as well. You could probably grep through the header files and figure it out.
You compile the CUDA 7.0 samples with the CUDA 6.5 toolkit. It uses cc5.2 in the make. That'd be the fastest way to find out. Probably found out already, so it'd be nice if you'd tell everyone else the specific version number you discovered worked with cc5.2 for us other lazy people. :)

nvprof application not found

I am trying to use Nvidia nvprof to profile my CUDA and OpenCL programs. However, whatever benchmark I choose, the only output is ======== Error: application not found. I have tried both CUDA and OpenCL benchmarks, and recompiled them several times, but it seems helpless.
My CUDA version: 4.2
NVIDIA Driver version: 334.21
Different from AMD sprofile, ./ is needed before the application name on Linux.
So you can call the profiler with this command:
nvprof ./ApplicationName

CUDA 5.0 wants the libcudart from CUDA 4.0?

I just upgraded from CUDA 4.2 to CUDA 5.0. Not surprisingly, the library that used to be named libcudart.so.4 is now called libcudart.so.5.0. After recompiling my code with nvcc 5.0, and attempting to running the code, I got this message:
./main: error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory
Yeah, you stupid system, I know there's no libcudart.so.4. That's because it's now called libcudart.so.5.0. Why is it looking for libcudart.so.4 instead of libcudart.so.5.0, and how can I fix it?
What I've tried so far:
I've checked that all my paths are in order. These environment variables are set:
export PATH=$PATH:/usr/local/cuda/bin:/usr/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib:/usr/local/cuda/lib64:/lib
#note: /usr/local/cuda is symlinked to /usr/local/cuda-5.0
I've verified that libcudart.so.5.0 can be found in one of the LD_LIBRARY_PATH directories.
I recompiled my CUDA application with the the CUDA 5.0 version of nvcc. I successfully compiled and ran my application on an other machine with CUDA 4.2, and on an other machine with CUDA 4.0.
I confirmed that nvcc is really on version 5.0:
user#host$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Fri_Sep_21_17:28:58_PDT_2012
Cuda compilation tools, release 5.0, V0.2.122
I'd like to get this question off the unanswered list, and I don't think #Jared Hoberock will mind, so I'm going to post his comment as an answer. If there's a concern and Jared or solvingPuzzles posts an answer, I'll delete mine (assuming it's not accepted -- I can't delete an accepted answere AFAIK).
nvcc seems to be statically linking against libcudart.a version 4.
Somewhere in your lib path, it seems that nvcc is finding an old libcudart.a, which needs to be removed.
For other readers, it's probably just sufficient to find all instances of libcudart.* on the system and delete any that don't match your desired CUDA version (assuming you're not trying to run a machine with multiple CUDA versions available -- in that case, the library paths for both compiling and running have to be managed appropriately)

How to output C/C++ annotated PTX in CUDA 4.1/4.2/5.0

Does anybody know how to get PTX assembler annotated with C/C++ code with new LLVM back-end?
Can easily get it with CUDA 4.0 or earlier but NVCC rejects all my flags after upgrading CUDA toolkit to version 4.2.
nvcc from CUDA 6.0 preview supports option --source-in-ptx.
Does nvcc.exe --opencc-options -LIST:source=on -ptx kernel.cu work? I have installed cuda 4.2 and this command generates *.ptx file with commented C code between ptx assembler lines.
You may want to use the --source-in-ptx and -G nvcc flags to see your original code in the PTX file.