I'm novice to cuda. I want to use cublas functionality in cuda programs and would like to know the procedure on how to use it. As my program is giving error i.e. *"cublas_v2.h file not present"* when I try to run it on GPU.
2
votes
That is a compilation error, npt a runtime errpr. If you want help, please accurately describe your problem and ask an actual question.
- talonmies
I've downloaded cublas.run file from developer.nvidia.com/cublas now I want to know how to run this file on GPU so that I can use cublas.h header file in Example 1 on docs.nvidia.com/cuda/cublas/index.html. One thing more how can i get the source code of cublas library.
- user2167322
The cublas.run file? Perhaps you mean the cuda toolkit .run file. You need to install the cuda toolkit first using the instructions appropriate for your operating system. Follow the appropriate getting started guide for your OS here. The source code of the cublas library is not available.
- Robert Crovella
2 Answers
5
votes
- The cublas documentation is contained here. So you should familiarize yourself with it.
- Try and run a sample program. There are samples in the CUDA samples that come with the CUDA 5 toolkit, or you can try the one here. Make sure you understand how to build and run that example.
- If you're still having trouble with your own program, post a new question here with the specifics. For example, if your program is giving error output, paste in the complete error output that you are getting, and paste in the code from your program that is generating that error output (at least). Preferably paste in your whole program, or a simple version that will reproduce the error.
The error you're getting right now looks like it should be coming from the compiler not from when you run the program. If so you simply need to tell the compiler where to find that header file. If you look at a cuda sample like this one, you can see from the included makefile how to tell the compiler where to look for header files.
1
votes
There can be multiple things because of which you must be struggling to run a code which makes use of the CuBlas library.
- The most important thing is to compile your source code with -lcublas flag. It should look like nvcc -c example.cu -o example -lcublas
- Secondly, confirm whether you have Cublas Library in your system.
As it says "cublas_v2.h file not present", try doing "whereis cublas_v2.h"
or search manually for the file, if it is not there you need to install
Cublas library from Nvidia's website. - Confirm your Cuda Installation path and LD_LIBRARY_PATH Your cuda path should be /usr/local/cuda. and LD_LIBRARY_PATH should be /usr/local/cuda/lib64 OR /usr/local/cuda/lib.