准备文件:
- cudatoolkit_4.0.17_linux_64_ubuntu10.10.run
- gpucomputingsdk_4.0.17_linux.run
- NPP_3.1_Linux64.tar.gz
- OpenCV-2.3.1a.tar.bz2
安装显卡驱动:
- 下载NVIDIA官方驱动安装,笔者使用:./NVIDIA-Linux-x86_64-295.40.run
- 建立nvidia设备文件以及开发nvidia内核模块
安装cuda:
- sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
- ./cudatoolkit_4.0.17_linux_64_ubuntu10.10.run
- 设置环境变量:
export CUDA_HOME="/opt/cuda" export CUDA_LIB="$CUDA_HOME/lib64:$CUDA_HOME/lib" export PATH="$CUDA_HOME/bin:$PATH" export LD_LIBRARY_PATH="$CUDA_LIB:$LD_LIBRARY_PATH"
- ./gpucomputingsdk_4.0.17_linux.run
- 测试:
cd ~/NVIDIA_GPU_Computing_SDK/C # use gcc-4.4 g++-4.4 make # test if work ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/deviceQuery
安装opencv
- tar -xvf NPP_3.1_Linux64.tar.gz
- tar -xvf OpenCV-2.3.1a.tar.bz2
- cd OpenCV-2.3.1
- sudo apt-get install libjpeg62-dev
- sudo apt-get install libtiff4-dev
- sudo apt-get install build-essential libavcodec-dev libavformat-dev libjpeg62-dev cmake libswscale-dev libjasper-dev
- NPP_SDK=$(readlink -f ../NPP_3.1_Linux64)
- cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_NPP_LIBRARY_ROOT_DIR=$NPP_SDK -D WITH_CUDA=ON -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON .
- make
- sudo make install
cd samplessudo apt-get install pkg-configchmod +x build_all.sh
参考:
发表评论
要发表评论,您必须先登录。