Search code examples
c++cudacaffe

C++ program using Caffe with CUDA


I try to run a program with Cuda.

To build Caffe and make runtest was fine.

But I got the error messages when I compile a simple code.

Of course, I had link include and library.

/usr/local/include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory

Do you have any suggestions?


Solution

  • Which version of the Cuda you are using. You might need to reinstall CUDA.

    If after you re-install the cuda, and still get the error:

    In order to fix the cublas error, you will have to include the path to your cuda folder.

    1. locate cublas_v2.h -- this should give you the path to your cuda installation
    2. export CPLUS_INCLUDE_PATH=/your/cuda/path:$CPLUS_INCLUDE_PATH

    Your cuda path will look something like: /opt/cuda-X.0/include

    Hope this helps.