cudnn.hpp中 cudnnGetErrorString与cudnn.h不兼容问题

Thanks for the great tutorial!
I have been using Caffe on linux for a while now, but since I’m new to linux I was always struggling to get things working.
This makes life a lot easier!
I compiled it on windows 7, VS2013, CUDA7.0

Everything works, including my own previous “linux caffe” experiments.
Only problem: it’s quite a lot slower, in the order of 3 times slower.
This is probably due to CUDNN, which I couldn’t get to work.

I have used the latest master branch by BVLC (08 juli 2015) and tried the following things to get CUDNN working:

first attempt with latest CUDNN (cudnn-6.5-win-v2-rc3)
– Add path to CUDNN folder to “additional include dirs”
– Add path to CUDNN folder to “additional library dirs”
– Add cudnn.lib, cudnn64_65.lib to “additional dependencies”
– add “USE_CUDNN” to the preprocessor definitions
– set CUDA C/C++ -> common-> target machine type” to “64 bit”

If I now try to compile any of the cudnn layers, for instance: cudnn_conv_layer.c, I get the following errors:

IntelliSense: declaration is incompatible with “const char *__stdcall cudnnGetErrorString(cudnnStatus_t status)” (declared at line 98 of “D:\toolkits\cudnn_v2\cudnn.h”) d:\caffe\caffe-master\include\caffe\util\cudnn.hpp 17 20 caffe
Error

error MSB3721: The command “”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\bin\nvcc.exe” -gencode=arch=compute_30,code=\”sm_30,compute_30\” –use-local-env –cl-version 2013 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64″ -I../3rdparty/include -I../3rdparty/include/openblas -I../3rdparty/include/hdf5 -I../3rdparty/include/lmdb -I../include -I../src -ID:\toolkits\boost_1_56_0 -I”D:\toolkits\opencv-2.4.9\build\include” -I”D:\toolkits\opencv-2.4.9\build\include\opencv” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” -ID:\toolkits\cudnn_v2 -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” –keep-dir x64\Release -maxrregcount=0 –machine 64 –compile -cudart static -DWIN32 -DNDEBUG -D_CONSOLE -D_LIB -D_CRT_SECURE_NO_WARNINGS -DUSE_CUDNN -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MD ” -o x64\Release\cudnn_conv_layer.cu.obj“D:\caffe\caffe-master\src\caffe\layers\cudnn_conv_layer.cu”” exited with code 2.

error : declaration is incompatible with “const char *cudnnGetErrorString(cudnnStatus_t)” D:\caffe\caffe-master\include\caffe\util\cudnn.hpp 17 1 caffe

It seems that there are some incompatibilities between CUDNN V2 and caffe CUDNN layers.
If I instead use CUDNN V1 I get some other errors:

IntelliSense: expected a ‘;’ d:\caffe\caffe-master\include\caffe\util\cudnn.hpp 127 1

error MSB3721: The command “”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\bin\nvcc.exe” -gencode=arch=compute_30,code=\”sm_30,compute_30\” –use-local-env –cl-version 2013 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64″ -I../3rdparty/include -I../3rdparty/include/openblas -I../3rdparty/include/hdf5 -I../3rdparty/include/lmdb -I../include -I../src -ID:\toolkits\boost_1_56_0 -I”D:\toolkits\opencv-2.4.9\build\include” -I”D:\toolkits\opencv-2.4.9\build\include\opencv” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” -ID:\toolkits\cudnn_v1 -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” –keep-dir x64\Release -maxrregcount=0 –machine 64 –compile -cudart static -DWIN32 -DNDEBUG -D_CONSOLE -D_LIB -D_CRT_SECURE_NO_WARNINGS -DUSE_CUDNN -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MD ” -o x64\Release\conv_layer.cu.obj“D:\caffe\caffe-master\src\caffe\layers\conv_layer.cu”” exited with code 2.

error : identifier “cudnnTensorDescriptor_t” is undefined D:\caffe\caffe-master\include\caffe\util\cudnn.hpp 64 1 caffe
error : identifier “cudnnTensorDescriptor_t” is undefined D:\caffe\caffe-master\include\caffe\util\cudnn.hpp 69 1 caffe
error : identifier “cudnnTensorDescriptor_t” is undefined D:\caffe\caffe-master\include\caffe\util\cudnn.hpp 77 1 caffe
error : identifier “cudnnTensorDescriptor_t” is undefined D:\caffe\caffe-master\include\caffe\util\cudnn.hpp 102 1 caffe

It now seems that “cudnnTensorDescriptor_t” can not be found at all, as opposed to an incompatible declaration.
Now ofcourse the question, what am I doing wrong? Did I forget something, or should I use a different version of CUDNN (any of the Release candidates maybe?)

I would be really gratefull if you, or anyone else, could help me out :)

Reply

    1. Freerk Venhuizen

      July 9, 2015 at 8:13 am

      Solved it!
      Using CUDNN v2, I had to change the following in cudnn.hpp

      “inline const char* cudnnGetErrorString(cudnnStatus_t status)”
      to
      “inline const char * CUDNNWINAPI cudnnGetErrorString(cudnnStatus_t status)”

      Now it works great with a speedup of 3x, similiar to linux performance

时间: 2024-08-05 07:18:53

cudnn.hpp中 cudnnGetErrorString与cudnn.h不兼容问题的相关文章

caffe编译报错 cudnn.hpp:127:41: error: too few arguments to function ‘cudnnStatus_t cudnnSetPooling2dDescriptor

转载自: https://blog.csdn.net/u011070171/article/details/52292680 这是因为当前版本的caffe的cudnn实现与系统所安装的cudnn的版本不一致引起的. 解决办法: 1.将./include/caffe/util/cudnn.hpp 换成最新版的caffe里的cudnn的实现,即相应的cudnn.hpp. 2. 将./include/caffe/layers里的,所有以cudnn开头的文件,例如cudnn_conv_layer.hpp

fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?

fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加"#include "stdafx.h""? vs开发时经常遇到没加stdafx.h头文件,解决办法就是吧预编译头去掉! fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加"#include "stdafx.h""?,布布扣,bubuko.com fatal error C1010: 在查找

VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h

VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h 编译提示:fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加“#include "stdafx.h"”? 错误分析:此错误发生的原因是编译器在寻找预编译指示头文件(默认#include "stdafx.h")时,文件未预期结束.没有找到预编译指示信息的头文件"stdafx.h".    (因为工程中的每个cpp文

初入 OpenGL ---白屏问题 -- glad.c在查找预编译头遇到意外的文件结尾,是否忘记向源中添加#include "stdafx.h" ?

学习地址:https://learnopengl-cn.github.io 学习成果: 前言: 跟着教程走,用VS2017 配置完了OpenGL的运行. 不得不说...这玩意配置比JAVA配置还麻烦... 好在终于跑起来了. 感谢 Bruce_wjh 博主的配置教程,比官方的好很多.(可惜还有些缺陷) https://blog.csdn.net/qq_37338983/article/details/78997179 问题1: 直接往项目中添加glad.c 会报错: ----glad.c在查找预

caffe报错:cudnn.hpp:86] Check failed: status == CUDNN_STATUS_SUCCESS (3 vs. 0) CUDNN_STATUS_BAD_PARAM 原因

在实际项目中出现的该问题,起初以为是cudnn版本的问题,后来才定位到在网络进行reshape操作的时候 input_layer->Reshape({(int)imgin.size(), input_layer->shape(1), input_layer->shape(2), input_layer->shape(3)}); 如上所示,第一个参数是输入图片的尺寸,在实际的视频中,输入的图片尺寸有可能为0,那么在reshape操作的时候就会报错. 在外层加一个保护就好了. 原文地址

Win10中CUDA、cuDNN的安装与卸载

https://blog.csdn.net/XunCiy/article/details/89070315?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1 原文地址:https://www.cnblo

解决linux下oracle进入sqlplus环境中后退键显示^H、上下键无效与ctrl+l无法清屏等问题【weber出品必属精品】

习惯linux中上下键回退历史输入的人们肯定也希望sqlplus中也能实现相同的效果,可是不幸的是,sqlplus中不提供诸多方便的快捷键,这个时候我们就需要另外安装一个插件来实现这个想法. 这个插件叫做: rlwrap 进入rlwrap的官网去下载这个插件:http://utopia.knoware.nl/~hlub/uck/rlwrap/ 下载完后进行解压操作tar -zxf rlwrap-0.41.tar.gz 解压后得到rlwrap这个文件夹,进入其中. 给configure赋权 # c

C++中头文件(.h)和源文件(.cpp)都应该写些什么

头文件(.h): 写类的声明(包括类里面的成员和方法的声明).函数原型.#define常数等,但一般来说不写出具体的实现. 在写头文件时需要注意,在开头和结尾处必须按照如下样式加上预编译语句(如下): #ifndef CIRCLE_H #define CIRCLE_H //你的代码写在这里 #endif 这样做是为了防止重复编译,不这样做就有可能出错. 至于CIRCLE_H这个名字实际上是无所谓的,你叫什么都行,只要符合规范都行.原则上来说,非常建议把它写成这种形式,因为比较容易和头文件的名字对

GNU Linux 64位系统中fatal error: stdio.h: 没有那个文件或目录的错误的解决方法

在64位系统中,编写一个C语言程序后,使用gcc进行编译时,出现了如下的错误: test.c:1:19: fatal  error: stdio.h: 没有那个文件或目录 #include <stdio.h> 针对以上的情况,对于在32环境下一般不会出现这个问题,因为已经把libc的头文件包括在系统中了,那么针对这样的情况,主要检查是否安装了完备的开发环境: build-essential package - Installs the following collection to compi