笔记本装的是win7+ubuntu14.04双系统,启动管理用的是easyBCD,重装ubuntu首先需要修复mbr,百度下载MBRFix.exe(或MBRFix64.exe),解压后放置在C盘根目录,win+R键打开命令行,输入cmd回车打开DOS,输入命令MbrFix /drive 0 fixmbr /win7 /yes,即可删除mbr,在easybcd的edit boot menu项中删除ubuntu启动项,重启电脑,之后右击计算机-管理-磁盘管理,找到之前为ubuntu分配的空间,右击删除卷。
此处可参考http://blog.csdn.net/Jalong_Ma/article/details/52743923,其中安装opencv3.0的部分可以忽略,直接选择安装opencv2.4.13版本即可。刷机过程中可能会在某些地方等待较长时间,耐心等待即可。
此处坑比较多,我第一次安装也是过程曲折
$ sudo add-apt-repository universe
$ sudo apt-get update
$ sudo apt-get install cmake git aptitude screen g++ libboost-all-dev \
libgflags-dev libgoogle-glog-dev protobuf-compiler libprotobuf-dev \
bc libblas-dev libatlas-dev libhdf5-dev libleveldb-dev liblmdb-dev \
libsnappy-dev libatlas-base-dev python-numpy libgflags-dev \
libgoogle-glog-dev python-skimage python-protobuf python-pandas \
libopencv-dev
上面提到的每一项务必都保证正确安装之后再进行下一步,安装opencv时可能会提示有有些依赖项未安装,按提示安装之后即可。
此处参考了 http://blog.csdn.net/q6324266/article/details/52193076
不可下载英伟达自己的caffe,可用以下命令下载:
$ git clone https://github.com/BVLC/caffe.git
首先修改配置文件,将caffe目录下自带的Makefile.config.examples文件改名为Makefile.config,去掉第五行的#号,即把#use_cudnn :=1改为use_cudnn :=1。
找到下面行:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
修改为:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/
CXX src/caffe/solvers/nesterov_solver.cpp
CXX src/caffe/data_reader.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/solver.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:566: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
修改caffe里面的Makefile 文件(注意不是Makefile.config) $ bash ./date/mnist/get_mnist.sh
$ bash ./examples/mnist/create_mnist.sh
$ bash ./examples/mnist/train_lenet.sh
运行成功说明caffe被成功安装。F0221 16:54:21.855986 11564 im2col.cu:49] Cuda kernel failed. Error: invalid device function
*** Check failure stack trace: ***
@ 0x7f2556cc1b4d google::LogMessage::Fail()
@ 0x7f2556cc5b67 google::LogMessage::SendToLog()
@ 0x7f2556cc39e9 google::LogMessage::Flush()
@ 0x7f2556cc3ced google::LogMessageFatal::~LogMessageFatal()
@ 0x463bf2 caffe::im2col_gpu<>()
@ 0x452031 caffe::ConvolutionLayer<>::Forward_gpu()
@ 0x41288f caffe::Layer<>::Forward()
@ 0x41c9be caffe::ConvolutionLayerTest_TestSimpleConvolution_Test<>::TestBody()
@ 0x43becd testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x42dab1 testing::Test::Run()
@ 0x42db97 testing::TestInfo::Run()
@ 0x42dcd7 testing::TestCase::Run()
@ 0x432bdf testing::internal::UnitTestImpl::RunAllTests()
@ 0x43ba7d testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x42d0da testing::UnitTest::Run()
@ 0x40f774 main
@ 0x318ae1ecdd (unknown)
@ 0x40f4c9 (unknown)
说明gpu未被成功配置,解决此问题需要重新编译caffe,
GPU | Compute Capability |
---|---|
Tesla K80 | 3.7 |
Tesla K40 | 3.5 |
Tesla K20 | 3.5 |
Tesla C2075 | 2.0 |
Tesla C2050/C2070 | 2.0 |
Tesla M40 | 5.2 |
Tesla K80 | 3.7 |
Tesla K40 | 3.5 |
Tesla K20 | 3.5 |
Tesla K10 | 3.0 |
Tesla M20xx | 2.0 |
Quadro M6000 24GB | 5.2 |
Quadro M6000 | 5.2 |
Quadro K6000 | 3.5 |
Quadro M5000 | 5.2 |
Quadro K5200 | 3.5 |
Quadro K5000 | 3.0 |
Quadro M4000 | 5.2 |
Quadro K4200 | 3.0 |
Quadro K4000 | 3.0 |
Quadro M2000 | 5.2 |
Quadro K2200 | 5.0 |
Quadro K2000 | 3.0 |
Quadro K2000D | 3.0 |
Quadro K1200 | 5.0 |
Quadro K620 | 5.0 |
Quadro K600 | 3.0 |
Quadro K420 | 3.0 |
Quadro 410 | 3.0 |
Quadro Plex 7000 | 2.0 |
Quadro K6000M | 3.0 |
Quadro M5500M | 5.0 |
Quadro K5200M | 3.0 |
Quadro K5100M | 3.0 |
Quadro M5000M | 5.0 |
Quadro K500M | 3.0 |
Quadro K4200M | 3.0 |
Quadro K4100M | 3.0 |
Quadro M4000M | 5.0 |
Quadro K3100M | 3.0 |
Quadro M3000M | 5.0 |
Quadro K2200M | 5.0 |
Quadro K2100M | 3.0 |
Quadro M2000M | 5.0 |
Quadro K1100M | 3.0 |
Quadro M1000M | 5.0 |
Quadro K620M | 5.0 |
Quadro K610M | 3.5 |
Quadro M600M | 5.0 |
Quadro K510M | 3.5 |
Quadro M500M | 5.0 |
NVIDIA NVS 810 | 5.0 |
NVIDIA NVS 510 | 3.0 |
NVIDIA NVS 315 | 2.1 |
NVIDIA NVS 310 | 2.1 |
NVS 5400M | 2.1 |
NVS 5200M | 2.1 |
NVS 4200M | 2.1 |
NVIDIA TITAN X | 6.1 |
GeForce GTX 1080 | 6.1 |
GeForce GTX 1070 | 6.1 |
GeForce GTX 1060 | 6.1 |
GeForce GTX TITAN X | 5.2 |
GeForce GTX TITAN Z | 3.5 |
GeForce GTX TITAN Black | 3.5 |
GeForce GTX TITAN | 3.5 |
GeForce GTX 980 Ti | 5.2 |
GeForce GTX 980 | 5.2 |
GeForce GTX 970 | 5.2 |
GeForce GTX 960 | 5.2 |
GeForce GTX 950 | 5.2 |
GeForce GTX 780 Ti | 3.5 |
GeForce GTX 780 | 3.5 |
GeForce GTX 770 | 3.0 |
GeForce GTX 760 | 3.0 |
GeForce GTX 750 Ti | 5.0 |
GeForce GTX 750 | 5.0 |
GeForce GTX 690 | 3.0 |
GeForce GTX 680 | 3.0 |
GeForce GTX 670 | 3.0 |
GeForce GTX 660 Ti | 3.0 |
GeForce GTX 660 | 3.0 |
GeForce GTX 650 Ti BOOST | 3.0 |
GeForce GTX 650 Ti | 3.0 |
GeForce GTX 650 | 3.0 |
GeForce GTX 560 Ti | 2.1 |
GeForce GTX 550 Ti | 2.1 |
GeForce GTX 460 | 2.1 |
GeForce GTS 450 | 2.1 |
GeForce GTS 450* | 2.1 |
GeForce GTX 590 | 2.0 |
GeForce GTX 580 | 2.0 |
GeForce GTX 570 | 2.0 |
GeForce GTX 480 | 2.0 |
GeForce GTX 470 | 2.0 |
GeForce GTX 465 | 2.0 |
GeForce GT 740 | 3.0 |
GeForce GT 730 | 3.5 |
GeForce GT 730 DDR3,128bit | 2.1 |
GeForce GT 720 | 3.5 |
GeForce GT 705* | 3.5 |
GeForce GT 640 (GDDR5) | 3.5 |
GeForce GT 640 (GDDR3) | 2.1 |
GeForce GT 630 | 2.1 |
GeForce GT 620 | 2.1 |
GeForce GT 610 | 2.1 |
GeForce GT 520 | 2.1 |
GeForce GT 440 | 2.1 |
GeForce GT 440* | 2.1 |
GeForce GT 430 | 2.1 |
GeForce GT 430* | 2.1 |
GeForce GTX 980 | 5.2 |
GeForce GTX 980M | 5.2 |
GeForce GTX 970M | 5.2 |
GeForce GTX 965M | 5.2 |
GeForce GTX 960M | 5.0 |
GeForce GTX 950M | 5.0 |
GeForce 940M | 5.0 |
GeForce 930M | 5.0 |
GeForce 920M | 3.5 |
GeForce 910M | 5.2 |
GeForce GTX 880M | 3.0 |
GeForce GTX 870M | 3.0 |
GeForce GTX 860M | 3.0/5.0(**) |
GeForce GTX 850M | 5.0 |
GeForce 840M | 5.0 |
GeForce 830M | 5.0 |
GeForce 820M | 2.1 |
GeForce 800M | 2.1 |
GeForce GTX 780M | 3.0 |
GeForce GTX 770M | 3.0 |
GeForce GTX 765M | 3.0 |
GeForce GTX 760M | 3.0 |
GeForce GTX 680MX | 3.0 |
GeForce GTX 680M | 3.0 |
GeForce GTX 675MX | 3.0 |
GeForce GTX 675M | 2.1 |
GeForce GTX 670MX | 3.0 |
GeForce GTX 670M | 2.1 |
GeForce GTX 660M | 3.0 |
GeForce GT 750M | 3.0 |
GeForce GT 650M | 3.0 |
GeForce GT 745M | 3.0 |
GeForce GT 645M | 3.0 |
GeForce GT 740M | 3.0 |
GeForce GT 730M | 3.0 |
GeForce GT 640M | 3.0 |
GeForce GT 640M LE | 3.0 |
GeForce GT 735M | 3.0 |
GeForce GT 635M | 2.1 |
GeForce GT 730M | 3.0 |
GeForce GT 630M | 2.1 |
GeForce GT 625M | 2.1 |
GeForce GT 720M | 2.1 |
GeForce GT 620M | 2.1 |
GeForce 710M | 2.1 |
GeForce 705M | 2.1 |
GeForce 610M | 2.1 |
GeForce GTX 580M | 2.1 |
GeForce GTX 570M | 2.1 |
GeForce GTX 560M | 2.1 |
GeForce GT 555M | 2.1 |
GeForce GT 550M | 2.1 |
GeForce GT 540M | 2.1 |
GeForce GT 525M | 2.1 |
GeForce GT 520MX | 2.1 |
GeForce GT 520M | 2.1 |
GeForce GTX 485M | 2.1 |
GeForce GTX 470M | 2.1 |
GeForce GTX 460M | 2.1 |
GeForce GT 445M | 2.1 |
GeForce GT 435M | 2.1 |
GeForce GT 420M | 2.1 |
GeForce GT 415M | 2.1 |
GeForce GTX 480M | 2.0 |
GeForce 710M | 2.1 |
GeForce 410M | 2.1 |
Tegra X1 | 5.3 |
Tegra K1 | 3.2 |
Jetson TK1 | 3.2 |
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61
检查是否包含自己GPU的型号,假如自己型号为35,则修改为:
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_35,code=compute_35
其他型号以此类推,完成后保存退出;