最近又搭了一次环境(Ubuntu14.04、CUDA8.0、cuDNN5.1、Torch7、zbs_torch)。
安装好Ubuntu14.04后,首先安装CUDA8.0,其次是cuDNN5.1,之后是Torch7,最后是zbs_torch。
- CUDA8.0:为了安装CUDA8.0,要卸载系统自带的显卡驱动
sudo apt-get remove xserver-xorg-video*
在官网下载到CUDA最新版的deb包(这里是cuda-repo-ubuntu1404-8-0-local_8.0.44-1_amd64.deb),然后安装CUDA(安装CUDA的过程会自动安装对应的NVIDIA驱动)
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
编译CUDA Sample
cd /usr/local/cuda/samples
sudo make
编译完成后,运行deviceQuery可以显示显卡信息
cd bin/x86_64/linux/release
sudo ./deviceQuery
- cuDNN5.1:在官网下载到cuDNN的两个deb包(cuDNN v5.1 Runtime Library for Ubuntu14.04 (Deb)和cuDNN v5.1 Developer Library for Ubuntu14.04 (Deb)),首先双击安装Runtime包,之后双击安装Developer包
- Torch7
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
git clone https://github.com/torch/distro.git ~/torch –recursive
cd ~/torch; ./install.sh
安装到最后输入yes把Torch的路径加入到全局设置,最后更新bashrc
source ~/.bashrc
- zbs_torch:首先安装luarocks
sudo apt-get install luarocks
之后安装mobdebug
luarocks install mobdebug
下载zbs_torch
git clone https://github.com/soumith/zbs-torch.git
启动zbs_torch
cd zbs-torch
./zbstudio.sh开启debugger服务:”Project->Start Debugger Server”,使用下面的语句debug
require(‘mobdebug’).start()
设置为Torch7:”Project->Lua Interpreter->Torch-7″