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. :)
Related
I used below command to build binary for nvidia GPU:
clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda simple-sycl-app.cpp -o simple-sycl-app-cuda
But got below error message:
clang++: error: cannot find 'libspirv-nvptx64--nvidiacl.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv
I searched in both intel oneAPI installation path and cuda toolkit path, but cannot find the spirv-nvptx64-nvidiacl.bc.
Anyone knows where to find libspirv-nvptx64—nvidiacl.bc?
It looks like you are trying to compile using the DPC++ compiler for Nvidia GPUs.
This option is not included in the oneAPI release installations from the Intel website. At the moment you will need to compile the DPC++ LLVM project with this enabled to be able to use the appropriate flag to target Nvidia devices.
You can follow the instructions on this page to compile the project and then it explains how to use the ptx target. In the future Codeplay, the company I work for, intends to publish release binaries that include the ptx compiler option.
Is there any way to install only the nvcc compiler without installing cuda toolkit?
I want this because I want to compile the cuda program just for syntax check.
Please suggest if there are any other ways for cuda syntax checking
As far I as know, the smallest level of installation granularity in current CUDA distributions is the entire toolkit. There is no way to just install nvcc (and in reality that implies installing a number of binary components beyond the compiler driver, plus all the toolchain header files).
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
I'm trying to do some CUDA development on a PC without CUDA-capable GPU via emulation mode. The OS is Linux Mint Debian (can be considered Debian testing for all practical purposes) 32bit (2.6.32-5-686 kernel). Here's what I did so far:
Grabbed the CUDA Toolkit 32 bit and SDK for Ubuntu from http://developer.nvidia.com/cuda-toolkit-40
Installed the CUDA Toolkit in /usr/local/cuda/lib
Added the paths to bashrc
echo "# CUDA stuff
PATH=\$PATH:/usr/local/cuda/bin
LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda/lib
export PATH
export LD_LIBRARY_PATH" >> ~/.bashrc
Added the path to /etc/ld.so.conf.d/cuda.conf:
/usr/local/cuda/lib
Executed "sudo ldconfig"
Restarted the session
Then installed the SDK in /home/user/NVIDIA_GPU_Computing_SDK folder
When I got to NVIDIA_GPU_Computing_SDK/C and type "make emu=1" to compile the examples I get:
nvcc warning : option 'device-emulation' has been deprecated and is ignored
/usr/bin/ld: cannot find -lcudartemu
/usr/bin/ld: cannot find -lcudartemu
collect2: ld returned 1 exit status
Seems like a library missing (rt = runtime ?). There is libcudart3 in the package manager, but wants a whole bunch of nvidia stuff as a dependency, including drivers and I don't even have an NVIDIA card on this machine. Also apparently the GPU emulation is now deprecated... Does anybody have some experience with CUDA emulation?
There is no emulation in CUDA any more. It was deprecated and removed during the 3.x release cycle. There is no emulation support beyond CUDA 3.1 IIRC. Certainly there is nothing you can do in CUDA 4.0.
On Linux, your best bet is to try gpuocelot, which provides a PTX level emulation on x86 processors and a reimplementation of the CUDA APIs.
Although I agree with the suggestion to try Ocelot, when I was in the same boat I found it easiest to go on eBay and get a cheap CUDA capable card to use for testing (I think I paid < $40). If you have the ability to open the hardware (I realize this isn't an option for some people) and to install drivers, that's what I'd suggest.
with a very simple code, hello world, the breakpoint is not working.
I can't write the exact comment since it's not written in English,
but it's like 'the symbols of this document are not loaded' or something.
there's not cuda codes, just only one line printf in main function.
The working environment is windows7 64bit, vc++2008 sp1, cuda toolkit 3.1 64bits.
Please give me some explanation on this. :)
So this is just a host application (i.e. nothing to do with CUDA) doing printf that you can't debug? Have you selected "Debug" as the configuration instead of "Release"?
Are you trying to use a Visual Studio breakpoint to stop in your CUDA device code (.cu)? If that is the case, then I'm pretty sure that you can't do that. NVIDIA has released Parallel NSIGHT, which should allow you to do debugging of CUDA device code (.cu), though I don't have much experience with it myself.
Did you compile with -g -G options as noted in the documentation?
NVCC, the NVIDIA CUDA compiler driver, provides a mechanism for generating the debugging information necessary for CUDA-GDB to work properly. The -g -G option pair must be passed to NVCC when an application is compiled for ease of debugging with CUDA-GDB; for example,
nvcc -g -G foo.cu -o foo
here: https://docs.nvidia.com/cuda/cuda-gdb/index.html