Step 5: Include cudnn.lib in your Visual Studio project

I do not understand the following in the cuDNN installation -

  1. Include cudnn.lib in your Visual Studio project.
    a. Open the Visual Studio project and right-click on the project name.
    b. Click Linker > Input > Additional Dependencies.
    c. Add cudnn.lib and click OK.

Can someone explain this step by step … with screen captures if possible

1 Like

Hi rzipper1,

I am having the same problem, did you find a solution yet?

This covers the method to add a library:

[url]visual studio 2010 - how to link library (e.g. CUBLAS, CUSPARSE) for CUDA on windows - Stack Overflow

Just follow the above instructions using cudnn.lib instead of cusparse.lib, for example.

If your cudnn.lib is in the same place as your cudart.lib, then the above method is all that is needed. If the cudnn.lib is somewhere else, then you will also need to update the linker search path in visual studio as well.

That is very much an issue of linking libraries, as it seems to me. Any libraries paths could be linked via GUI dialog menu.

That is like:

#include library

should have a corresponding reference like:

library path  C:\library

As long as linker knows where the library is located - it can be used.

However, to use for example Tensorflow within python is more interesting, in my opinion.

1 Like

I don’t understand this part either.
Is it necessary to use Visual Studio to make CUDA work in Python script?
When I install dlib it says: DLIB WILL USE CUDA, but it doesn’t when I’m checking with commands:

import dlib
dlib.DLIB_USE_CUDA

it says False for me, so how can I use it on Windows 10, Python 3.7, CUDA 10.2, Dlib 19.19 ?
GPU: GTX 1050 and MX150, updated drivers on both laptops but problem is the same 😫

2 Likes

Facing similar issue now. I am unable to see the Linker menu in my project solution (in step 3 here: https://stackoverflow.com/questions/13570285/how-to-link-library-e-g-cublas-cusparse-for-cuda-on-windows/13588857#13588857 ).

I’m using Visual Studio 2019 and I followed the steps here to generate the project using CMake: Dnn Module Build with Cuda support on windows 10 | by Amar Kumar | Medium

Any help would be highly appreciated.

2 Likes

me too

Hello
try these steps

  • Include cudnn.lib in your Visual Studio project.
    • Open the Visual Studio project and right-click on the project name then Properties.
    • Click Linker > General>Additional Library Directories
    • Add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\lib\x64
    • Click Linker > Input > Additional Dependencies.
    • Add cudnn.lib and click OK.
2 Likes
  • Open the Visual Studio project and right-click on the project name then Properties.
    for this step, i think we should crear a new project to do this, do you know what directory of the new project should be?