lspci | grep -i nvidia
2、Verify You Have a Supported Version of Linux
uname -m && cat /etc/*release
3、Verify the System Has gcc Installed
gcc --version
--or
yum groupinstall "Development Tools"
--or
yum install gcc gcc-c++ kernel-devel
4、Install OpenGL driver
yum install freeglut
ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
如果不安裝,在summary部分就會出現:
Samples: Installation Failed. Missing required libraries.
Missing required library libglut.so
5、Download the NVIDIA CUDA Toolkit
http://www.nvidia.com/content/cuda/cuda-downloads.html.
6、Install the NVIDIA CUDA Toolkit
1)Exit the GUI if you are in a GUI environment
/sbin/init 3
2) Install the CUDA Toolkit by running the downloaded .run file as a superuser.
sudo sh cuda_5.0.35_linux_64_rhel6.x-1.run
3) Define the environment variables.
The typical way to place these values in your environment is with the following commands:
export PATH=/usr/local/cuda-5.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib:$LD_LIBRARY_PATH
for 32-bit operating systems, or
export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:$LD_LIBRARY_PATH
for 64-bit operating systems.
To make such settings permanent
vi ~/.bashrc //如果需要多個用戶共同使用,修改/etc/profile:此文件爲系統的每個用戶設置環境信息,當用戶第一次登錄時,該文件被執行.
export PATH=$PATH:/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:$LD_LIBRARY_PATH4) CUDA SDK Samples
~/NVIDIA_CUDA-5.0_Samples
make
If everything goes well, you should be able to verify your CUDA installation by running the deviceQuery sample in bin/linux/release.
參考文獻
1.http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html
2. http://www.xue5.com/Developer/C++/492704.html
3.http://blog.sina.com.cn/s/blog_705c12e501017wvx.html