黑客与画家 2018-04-05
安装ubuntu 14.04时赞美Rufus,过程参考 https://www.cnblogs.com/willnote/p/6725594.html
-----------------------------------------------------------
!保!障!网!络!通!畅!
-----------------------------------------------------------
安装显卡驱动
sudo gedit /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
sudo update-initramfs -u
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
关机
开机
ctrl+alt+F1进入命令行模式,登录用户。
sudo apt-get remove --purge nvidia*安装依赖包
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libopenblas-dev liblapack-dev libatlas-base-devlibgflags-dev libgoogle-glog-dev liblmdb-dev -y
-----------------------------------------------------------sudo gedit~/.bashrc
export PATH=/usr/local/cuda-[版本号]/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-[版本号]/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-----------------------------------------------------------cd [NVIDIA_CUDA_SAMPLES]/1_Utilities/deviceQuery
sudo make
./deviceQuery #确认输出了有效的显卡信息
-----------------------------------------------------------
sudo cp [cudnn]/cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp [cudnn]/cuda/lib64/lib* /usr/local/cuda/lib64/
cd /usr/local/cuda/lib64/sudo rm -rf libcudnn.so libcudnn.so.[主版本号]
sudo ln -s libcudnn.so.[全版本号] libcudnn.so.[主版本号]
sudo ln -s libcudnn.so.[主版本号] libcudnn.so
sudo ldconfig
-----------------------------------------------------------
-----------------------------------------------------------
安装opencv-3.4.1 + contrib-master
contrib解压至[opencv]/modules/
下载ippicv_2017u3_lnx_intel64_general_20170822.tgz至 [opencv]/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e 改名为 4e0352ce96473837b1d671ce87f17359-ippicv_2017u3_lnx_intel64_general_20170822.tgz
cmake:
BUILD_DOCSBUILD_JPEGBUILD_PNG BUILD_opencv_worldOPENCV_EXTRA_MODULES_PATH([contrib]/modules)
configure两次确认无误(或者相关BLAS的错误,目前暂未发现负面影响)后generate
USE_CUDNN := 1
USE_OPENCV := 1
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/include/opencv /usr/local/include/opencv2 /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/lib/x86_64-linux-gnuCUDA_ARCH := #-gencode arch=compute_20,code=sm_20 \
#-gencode arch=compute_20,code=sm_21 \
ifeq ($(USE_OPENCV), 1)
#LIBRARIES += opencv_core opencv_highgui opencv_imgproc
#ifeq ($(OPENCV_VERSION), 3)
#LIBRARIES += opencv_imgcodecs
#endif
LIBRARIES += opencv_world
endif
make all -j[CPU内核数]
sudo gedit /etc/ld.so.conf.d/caffe.conf
/usr/local/cuda/lib64
sudo ldconfig
cd [caffe]
sudo sh data/mnist/get_mnist.sh
sudo sh examples/mnist/create_mnist.sh
sudo sh examples/mnist/train_lenet.sh
-----------------------------------------------------------
参考http://www.cnblogs.com/denny402/p/5083300.html开工