• 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: oolkitscudnn_v2cudnn.h”) d:caffecaffe-masterincludecaffeutilcudnn.hpp 17 20 caffe
    Error

    error MSB3721: The command “”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0innvcc.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.0VCinx86_amd64″ -I../3rdparty/include -I../3rdparty/include/openblas -I../3rdparty/include/hdf5 -I../3rdparty/include/lmdb -I../include -I../src -ID: oolkitsoost_1_56_0 -I”D: oolkitsopencv-2.4.9uildinclude” -I”D: oolkitsopencv-2.4.9uildincludeopencv” -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0include” -ID: oolkitscudnn_v2 -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0include” -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0include” –keep-dir x64Release -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 x64Releasecudnn_conv_layer.cu.obj“D:caffecaffe-mastersrccaffelayerscudnn_conv_layer.cu”” exited with code 2.

    error : declaration is incompatible with “const char *cudnnGetErrorString(cudnnStatus_t)” D:caffecaffe-masterincludecaffeutilcudnn.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:caffecaffe-masterincludecaffeutilcudnn.hpp 127 1

    error MSB3721: The command “”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0innvcc.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.0VCinx86_amd64″ -I../3rdparty/include -I../3rdparty/include/openblas -I../3rdparty/include/hdf5 -I../3rdparty/include/lmdb -I../include -I../src -ID: oolkitsoost_1_56_0 -I”D: oolkitsopencv-2.4.9uildinclude” -I”D: oolkitsopencv-2.4.9uildincludeopencv” -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0include” -ID: oolkitscudnn_v1 -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0include” -I”C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0include” –keep-dir x64Release -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 x64Releaseconv_layer.cu.obj“D:caffecaffe-mastersrccaffelayersconv_layer.cu”” exited with code 2.

    error : identifier “cudnnTensorDescriptor_t” is undefined D:caffecaffe-masterincludecaffeutilcudnn.hpp 64 1 caffe
    error : identifier “cudnnTensorDescriptor_t” is undefined D:caffecaffe-masterincludecaffeutilcudnn.hpp 69 1 caffe
    error : identifier “cudnnTensorDescriptor_t” is undefined D:caffecaffe-masterincludecaffeutilcudnn.hpp 77 1 caffe
    error : identifier “cudnnTensorDescriptor_t” is undefined D:caffecaffe-masterincludecaffeutilcudnn.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 :)

      1. Freerk Venhuizen 

        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

  • 相关阅读:
    netty同时做http和websocket(netty入门)
    curl的概念及相关工具下载
    当删除某一个jar包时tomcat中出现problem encountered while deleting resources问题
    一个servlet处理多个请求或者叫方法
    在web中实现当前变量和前一个的比较
    URL中可以出现的字符
    在Editplus直接运行程序的步骤
    socket的相关知识理解
    011 python接口 bs4提取结果
    010 python接口 bs4解析html
  • 原文地址:https://www.cnblogs.com/Erdos001/p/4905997.html
Copyright © 2020-2023  润新知