Word Count: 1,757
Read Count:
Series
Guide
requirements:
- windows: 10
- caffe:
caffe-windows
- nvidia driver: gtx 1060 382.05 (gtx 970m)
- GPU arch(s): sm_61 (sm_52)
- cuda: 8.0
- cudnn: 5.0.5
- opencv: 3.1.0 WITH_CUDA (compiled from source)
- other libs:
libraries_v140_x64_py27_1.1.0.tar.bz2
cuda+cudnn
- download and install driver by standalone for
GTX 970
orGTX 1060
from here. - download and install
cuda_8.0.61_win10.exe
, skip install nvidia driver and install toolkit only. - download and install
cudnn-8.0-windows10-x64-v5.0-ga.zip
.
nvidia driver
driver can be installed by standalone or from
we choose to install by standalone
cuda_xxx_win10.exe
.we choose to install by standalone
download proper driver for
GTX 970
or GTX 1060
eg: 398.36-notebook-win10-64bit-international-whql.exe
from here
cuda toolkit
ref: cuda install guides for windows
download
cuda_8.0.61_win10.exe
from here
The CUDA Toolkit installs the CUDA driver and tools needed to create, build and run a CUDA application as well as libraries, header files, CUDA samples source code, and other resources
cuda_8.0.61_win10.exe
includes: Nvidia driver + toolkit.
install to
- driver install to
C:/Program Files/NVIDIA Corporation
andC:/ProgramData/NVIDIA Corporation
- tookit install to
C:/Program Files/NVIDIA GPU Computing Toolkit
,which contains headers,libs,tools for compiling CUDA applications.C:/ProgramData/NVIDIA GPU Computing Toolkit
contains cuda plugins for Visual Studio.
verify
cudnn
extract
cudnn-8.0-windows10-x64-v5.0-ga.zip
and copy include
,lib
and bin
to C:Program FilesNVIDIA GPU Computing ToolkitCUDAv8.0
check cuda
compile
download
- place
caffe-windows
atC:/compile/caffe-windows
- extract
libraries_v140_x64_py27_1.1.0.tar.bz2
toC:Userszunli.caffedependencieslibraries_v140_x64_py27_1.1.0libraries
config
edit
C:Userszunli.caffedependencieslibraries_v140_x64_py27_1.1.0librariescaffe-builder-config.cmake
edit
caffe-windows/cmake/Dependencies.cmake
Tips:
(1) we use
(2) we use caffe
(1) we use
C:Boost
1.64 to replace caffe dependencies C:Userszunli.caffedependencieslibraries_v140_x64_py27_1.1.0libraries
1.61, because we have compile PCL 1.8.1
with Boost 1.64 static
.(2) we use caffe
C:Userszunli.caffedependencieslibraries_v140_x64_py27_1.1.0librariesx64vc14lib
to replace C:/Program Files/opencv
. (opencv3.1 <opencv3.4)
configure caffe with
with options
configure and output
build and install
tips: Visual Studio 2015 can not generate shared library. So we build static caffe library.
Build with
Release x64
with Visual Studio 2015
and 38 modules will be generated and We Install
to C:/car_libs/caffe/
.
build result.
install to
C:/car_libs/caffe
.
caffe usage
CMakeLists.txt
when we use
caffe
lib in our program, errors will occur. And we need to fix CaffeTargets-release.cmake
file。
usage error fix
(1) error with shared.lib
solution:
(2) error with
hdf5
hdf5.lib
>libcaffehdf5.lib
hdf5_hl.lib
>libcaffehdf5_hl.lib
(3) error with libopenblas
solution:
cd
C:Userszunli.caffedependencieslibraries_v140_x64_py27_1.1.0librarieslib
and
- copy
libopenblas.a
>libopenblas.a.lib
- copy
libopenblas.dll.a
>libopenblas.dll.a.lib
(4) error NtClose
solution:
CaffeTargets-release.cmake
edit
C:car_libscaffeshareCaffeCaffeTargets-release.cmake
comiple errors with caffe.pb.h
tips: sometimes we not need to do this.
CMakeLists.txt
vim
C:car_libscaffeincludecaffeprotocaffe.pb.h
replace
STRICT
and PERMISSIVE
to _STRICT
and _PERMISSIVE
.
run exe
Caffe Matlab File
- copy
C:/car_libs/caffe/bin/*.dll
dlls tobin/release
folder. - copy
Opencv
dlls tobin/release
folder.
Errors and Solutions
nvidia driver not compatible with windows 10
problem: install nvidia driver failed on windows 10
solution
- download Windows10Upgrade
- run
Windows10Upgrade.exe
to upgrade windows 10 to latest. - install nvidia driver again.
- OK.
Reference
History
- 20180413 created.
All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source kezunlin !