Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1028905
  • 博文数量: 123
  • 博客积分: 5051
  • 博客等级: 大校
  • 技术积分: 1356
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-14 10:56
文章分类
文章存档

2012年(1)

2011年(21)

2010年(13)

2009年(55)

2008年(33)

分类: LINUX

2011-06-17 17:26:11

1、download cuda toolkit and cuda sdk;
http://developer.nvidia.com/cuda-toolkit-32-downloads
drivers/toolkits/sdk all of these can be downloaded from the up url.

2、install the nvidia driver:
if you are in a GUI environment, exit the GUI((press ctrl-alt-backspace; 
some distributions require you to press this sequence twice in a row, others have 
disabled it altogether in favor of a command such as sudo /etc/init.d/gdm 
stop).);at the command line, turn off x windows via /sbin/init 3 then run the driver installation
package from the command line as a superuser. restart the GUI environment(startx or init 5)

3、install the cuda toolkit by running the downloaded .run file as a superuser. then it will
install defaults to /usr/local/cuda.PATH needs to include /usr/local/cuda/bin. LD_LIBRARY_PATH
needs to contain either /usr/local/cuda/lib or /usr/local/cuda/lib64 for 32- or 64- operating systems.

4、open file ~/.profile
export PATH=/usr/local/cuda/bin:$PATH 
export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PAT
but some times, you would failed if you do as like upper. when you compile in the C directory, and across
the following error:
CUDA-Multiforcer: error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory
then you can try the following method and correct this error:
modify file ld.so.conf in the /etc directory and add the following info:
/usr/local/cuda/lib or /usr/local/cuda/lib64
cuda is defaults to install in /usr/local
after modify file ld.so.conf, you must run ldconfig

ldconfig
ldconfig -v | grep cuda

then you will see some info and then make will be ok.

5、verify the installation
check cuda toolkit installation: nvcc -V.
6、running some exemples
in C/bin/linux/release, some many testings there. you can use the following commands to verify the sdk
is Ok or no.
for example:
sudo ./deviceQuery
then you will get enough information about you computer.

some time, when you compile the sdk, maybe you will get the error: /usr/bin/ld: -lGL can't find
because of the opengl in linux is messa, so only enter C/common directory and modify file common.mk,
and modify the -lGL into -lglut, then compile sdk will be OK.
阅读(1356) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~