How to check cuda and cudnn version

It will carry discussion on general topics. It may vary from ece, cse, coding and anything which helps in both growth and development
Post Reply
learner
Posts: 7
Joined: 28 Mar 2019

How to check cuda and cudnn version

Post by learner » 16 Jun 2019

Hello all!

I hope everything is well and going great. I have a question in my mind. I had installed both cuda and cudnn and was eager to know the version of these.

What did searched before asking question
I searched on internet and found the below solutions
For cuda

Code: Select all

cat /usr/local/cuda-x.x/version.txt
while I executed the above code, I got the right answer and I am happy with it

Where is the problem
I read somewhere how to find the version of cudnn. For this I have implemented the below line in the terminal

Code: Select all

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
What output I got after running the above command
cat: /usr/local/cuda/include/cudnn.h: No such file or directory

What is my thoughts now
I am fed up and is totally confused. Please someone help me. I need the help.

User avatar
Aisangam
Site Admin
Posts: 25
Joined: 24 Mar 2019
Location: Delhi, India
Contact:

Re: How to check cuda and cudnn version

Post by Aisangam » 16 Jun 2019

I think you are facing the problem because of lack of logics otherwise this is simple to resolve.

What to do to fix this

Step 1: This step is taken for knowing cuda version. Before executing the command

Code: Select all

cat /usr/local/cuda-x.x/version.txt


You must know where is the location of cuda in your system. This is an important step from my side. Please type the below command in the terminal

Code: Select all

locate cuda
You will get some output as shown here.

Now when you find the location of the cuda, then type the command which you are typing, you will get the right answer. I hope I have cleared the first part.

Step 2: Coming to the problem of cudnn. As I can see that no file of cudnn.h exists in /usr/local/cuda/include/. Let us locate the file cudnn.h first and then we will execute your command. Please type the below command in the terminal

Code: Select all

locate cudnn.h
You may get the answer as below /usr/include/cudnn.h. It may be different for your case or same in your case. Now we have known the location of cudnn.h. Great and excellent. Now please run the below command in the terminal

Code: Select all

cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2
You will get the output similar to this.

I hope you got your mistake. So on the concluding note, I would like to suggest you is to locate file before running an operation on it. This is because file at the right location is needed to execute any operation on it. I hope you would like the answer and it would help you.

With warm regards
https://www.aisangam.com/

Post Reply