when I compile caffe, find cublas_v2.h can't find;but the location is "/usr/local/cuda-7.0/include/cublas_v2.h" ,and CUDA_DIR := /usr/local/cuda-7.0 in Makefile.config
sudo make all -j4
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/net.cpp
CXX src/caffe/blob.cpp
CXX src/caffe/util/db_leveldb.cpp
In file included from ./include/caffe/common.hpp:19:0,
from src/caffe/net.cpp:8:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
#include
^
compilation terminated.
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/blob.hpp:8,
from src/caffe/blob.cpp:4:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
#include
^
compilation terminated.
make: ** [.build_release/src/caffe/net.o] Error 1
make: ** Waiting for unfinished jobs....
make: ** [.build_release/src/caffe/blob.o] Error 1
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/util/db.hpp:6,
from ./include/caffe/util/db_leveldb.hpp:9,
from src/caffe/util/db_leveldb.cpp:1:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
#include
^
compilation terminated.
make: *
sudo find / -name cublas_v2.h
/usr/local/cuda-7.0/include/cublas_v2.h
Seems that other people had the same problem, have a look:
https://groups.google.com/forum/#!topic/caffe-users/DAv5EcsvbIU
https://github.com/BVLC/caffe/issues/2329
https://github.com/melisgl/mgl-mat/issues/1
Closing as this does not appear to be a bug in Caffe. You may need to do a clean build or build using make Q= to debug; you're welcome to continue discussion on caffe-users.
Following the installation instructions for Python I also have this error. Sounds like it's a problem with the makefile.
Same issue, I get this error when I use CPY_ONLY build https://github.com/mrgloom/Caffe-snippets/blob/master/Makefile.config and using openblas installed via http://stackoverflow.com/questions/36483054/install-openblas-via-apt-get-sudo-apt-get-install-openblas-dev
I definitely not use CUDA what is the problem?
It seems that the compiler doesn't inherit the varible "CPU_ONLY" for some reason, right? If anyone knows how to properly "export" CPU_ONLY, don't hesitate and write here.
In the meanwhile, I installed the cuda toolkit (~1.5 to 2 GB) via 'sudo apt-get install nvidia-cuda-toolkit', as the Makefile.config.example is friendly enough to "suggest".
I'll correct this post if I encounter problems coming from any accidentially installed cuda driver - that's what happened last time (different cuda install method). As of now, everything is running fine.
Seems you can use -DCPU_ONLY in Makefile of your project where you use Caffe as library or use #define CPU_ONLY in headers.
Seems simpler version is to build caffe with cmake like:
mkdir build
cd build
cmake .. -CPU_ONLY
I'm still having this problem, still the compiler calling cublas_v2.h: even tho its CPU_only. Any ideas how to solve this problem .. Thanks
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/blob.cpp
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/blob.hpp:8,
from src/caffe/blob.cpp:4:
./include/caffe/util/device_alternate.hpp:34:23: error fatal: cublas_v2.h: No existe e
Faced same issue, fixed by install CUDA _toolkit_. CUDA driver is not enough. In case of MacOS - please use that manual (but versions of python and macos should be fixed there)
I had the same problem after upgrading from cuda 7.5 to cuda 8.0. The reason for the error is that now the cuda directory is /usr/local/cuda-8.0 instead of just /usr/local/cuda and the fix is simple - open the Makefile.config and edit the line for CUDA_DIR
I'm still having this problem, I've tried to change the path of cuDNN and CUDA_PATH or CUDA_DIR, but it's generating the same error each time. Any other suggestion? Thanks.
@Minerva411 try @istrandjev method
two issues:
1.
vim ~/caffe/Makefile.config
edit
CUDA_DIR= /usr/local/cuda ----->CUDA_DIR= /usr/local/cuda-
In Ubuntu14.04, you can place cudnn.h into /usr/include and set the proper permission of it.
find where you install cudnn
sudo cp ~/cuda/include/cudnn.h /usr/include
and it get compile :champagne:
@YuehChuan Thanks, I will try it.
may works when build with cpu only, by:
Solved. Uncomment BLAS_INCLUDE and BLAS_LIB in the Makefile.config file and set it as BLAS installation destination.
In my case,
BLAS_INCLUDE := /usr /local/cuda/targets/x86_64-linux/include
BLAS_LIB := /usr /local/cuda/targets/x86_64-linux/lib
Even Though making the configuration to use CPU ONLY I had the problem with cublas_v2.h . The issue solved when I install CUDA toolkit... weird but worked...
I also had a problem "./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory" when I build caffe with CPU_ONLY mode. I found out that CPU_ONLY define is not passed to some make targets for some reasons. To avoid such problems I added line
add_definitions( -DCPU_ONLY=1 )
to the second line of CMakeLists.txt
For the latest version, if you're using CPU only, uncomment #CPU_ONLY := 1 in the Makefile.config will make it work. Hope this help.
I also had a problem "./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory" when I build caffe with CPU_ONLY mode. I found out that CPU_ONLY define is not passed to some make targets for some reasons. To avoid such problems I added line
add_definitions( -DCPU_ONLY=1 )
to the second line of CMakeLists.txt
For the latest version, if you're using CPU only, uncomment
#CPU_ONLY := 1in the Makefile.config will make it work. Hope this help.
Works fine, thanks!
cd /usr/local/cuda-10.0
for i in `ls`;do ln -s `pwd`/$i /usr/local/include/;done
Most helpful comment
I had the same problem after upgrading from cuda 7.5 to cuda 8.0. The reason for the error is that now the cuda directory is /usr/local/cuda-8.0 instead of just /usr/local/cuda and the fix is simple - open the Makefile.config and edit the line for CUDA_DIR