Compilation Error in cudnn_conv_layer.cpp: 'CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT’ was not declared in this scope
I have edited my makefile correctly for cuDNN and all other dependencies, as you may see attached. However, I am getting the error in my attached terminal windows when compiling src/caffe/layers/cudnn_conv_layer.cpp:5. The following variables were not declared in this scope: CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT
Upon googling, I found another person who faced the same problem: https://forums.developer.nvidia.com/t/jetpack-4-4-l4t-r32-4-3-production-release/140870/21. Someone from Nvidia replied to him saying that these cuDNN defines and functions were previously marked as deprecated and have now been removed. Looks like code in this repo was not updated to support the latest CUDA packages, so can anyone please give a solution? Maybe using an older version of cuDNN? Please help!
I have correctly installed Cuda 11.0, cuDNN 8.0 for Cuda 11.0, latest nvidia drivers(450) on my Ubuntu 20.04 machine with Nvidia's GTX 1050M graphics card.
Your system configuration
Operating system: Ubuntu 20.04 (Focal Fossa) Compiler: nvcc v11.0 CUDA version (if applicable): 11.0 CUDNN version (if applicable): 8.0 BLAS: OpenBLAS Python or MATLAB version (for pycaffe and matcaffe respectively): Python 3.8


I've tried to fix the issue. Tested with CUDA 10.2.89 and cuDNN 8.0.0.180. Works like charm. Q-engineering
Any updates? Please help!
Dear @4everZard,
I've got the same problem with Caffe and cuDNN version 8.
As of version 8, NVIDIA has dropped the cudnnGetConvolutionBackwardFilterAlgorithm. The other two obsolete API calls, cudnnGetConvolutionForwardAlgorithm and cudnnGetConvolutionBackwardDataAlgorithm, have some replacement.
Because there is no replacement for the cudnnGetConvolutionBackwardFilterAlgorithm I've followed the strategy of the PaddlePaddle framework, by giving the outcome a constant CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1 value and twice the memory earlier found with the cudnnGetConvolutionForwardAlgorithm.
I could request a merge in this repo, but not quite sure if the solution will work at all times, I decided to put it in our own GitHub repo first. If it turns out that it works fine, I will merge.
For now, please use this repo. It's a direct fork with OpenCV 4.4 support.
Thank you for your help! @Qengineering I am working with YOLOv3 and cuDNN version 8. I am not sure if this will work with YOLO but I will definitely give it a try!
Solution :
Weirdly I have to comment out bellow line in makefile.config to make it work.
It worked for now but I am not sure of the future consequences.
I found the solution here (if anyone wants to read more)
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
This worked for me
@torta24x Which CUDA and cuDNN version are you using? I've tested it with CUDA 10.2 and cuDNN 8.0.0.180.
@torta24x Which CUDA and cuDNN version are you using? I've tested it with CUDA 10.2 and cuDNN 8.0.0.180.
My bad, actually the cuDNN was not installed, will be installing it and re make caffe code.
FYI CUDA : 10.0.207
I have edited my makefile correctly for cuDNN and all other dependencies, as you may see attached. However, I am getting the error in my attached terminal windows when compiling src/caffe/layers/cudnn_conv_layer.cpp:5. The following variables were not declared in this scope: CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT these macros is defined in cudnn.h if you want to use cuDNN library. please add #include "cudnn.h in cudnn_deconv_layer.hpp. like this
#ifdef USE_CUDNN
#include "cudnn.h"
my platform is TX2. the cudnn library intall path is "/home/nvida/cuda/" so the caffe Makefile.config should add include search path. like this
#Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /home/nvdida/cuda/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/include /home/nvdida/cuda/lib64
Please try again.