'linux cuda'에 해당되는 글 1건

  1. 2010.12.05 CUDA 예제 컴파일시 오류
Programming/openCL & CUDA2010. 12. 5. 19:36
Linux에서 CUDA를 설치하고 예제를 컴파일 하려고 하니 다음과 같은 오류가 난다.

~/NVIDIA_GPU_Computing_SDK/C/src/deviceQuery$ make
/usr/bin/ld: cannot find -lcutil_i386
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/deviceQuery] 오류 1

경로설정이 잘못되었나 했는데, gcc 호환성으로 인해 구버전을 쓰라던 이야기가 떠오르게 하는 아래의 내용 -_-
NVIDIA Cuda ¶

Before running the Makefile, you will need to install gcc 4.3 and g++ 4.3. This is because the NVIDIA Cuda SDK 3.0 has not yet worked with gcc 4.0 and g++ 4.0. There should be no issue compiling cuda files with gcc 4.3 and g++ 4.3 on newer NVIDIA Cuda SDK versions. For a successful compilation, please follow these steps:

...

3) Create a directory and create symlinks to gcc-4.3/g++-4.3

$ mkdir mygcc
$ cd mygcc
$ ln -s $(which g++-4.3) g++
$ ln -s $(which gcc-4.3) gcc

[링크 : http://boinc.berkeley.edu/trac/wiki/GPUApp]


$ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ whereis g++
whwg++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz

$ whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1.gz

없는건 아닌데 왜 안될까..

일단.. 어거지로
~/NVIDIA_GPU_Computing_SDK/C 에서
make를 하니 어느정도 컴파일을 하는데 GLU 어쩌구 하면서 중단 OTL


libcudart.so.3: cannot open shared object file: No such file or directory

요런 에러가 발생하면
단순하게 LD_LIBRARY_PATH를 정해주고, sudo ldconfig 를 해서는 해결이 되지 않았다.
/etc/ld.so.conf.d/ 에 libcuda.conf를 만들고 cuda 설치 경로인
/usr/local/cuda/lib
를 넣어주고 나서 sudo ldconfig를 해야 제대로 설정이 되었다.


2010.12.07 추가
아래의 경로에서 libcutil_i386.a 발견! (별 의미는 없음)
~/NVIDIA_GPU_Computing_SDK/C/lib$ ll
합계 224
drwxr-xr-x 2 minimonk minimonk   4096 2010-12-05 23:58 ./
drwxr-xr-x 9 minimonk minimonk   4096 2010-12-05 23:58 ../
-rw-r--r-- 1 minimonk minimonk 142978 2010-12-05 23:58 libcutil_i386.a
-rw-r--r-- 1 minimonk minimonk  30512 2010-12-05 23:58 libparamgl_i386.a
-rw-r--r-- 1 minimonk minimonk  43034 2010-12-05 23:58 librendercheckgl_i386.a

~/NVIDIA_GPU_Computing_SDK/C/src/marchingCubes$ make
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/marchingCubes] 오류 1

$ sudo find / -name "*GLU*"
/usr/lib/libGLU.so.1
/usr/lib/libGLU.so.1.3.070701

$ sudo ln -s /usr/lib/libGLU.so.1 /usr/lib/libGLU.so

~/NVIDIA_GPU_Computing_SDK/C/src/marchingCubes$ make
/usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
make[1]: *** [../../bin/linux/release/marchingCubes] 오류 1

$ sudo ln -s /usr/lib/libX11.so.6 /usr/lib/libX11.so
$ sudo ln -s /usr/lib/libXi.so.6 /usr/lib/libXi.so
$ sudo ln -s /usr/lib/libXmu.so.6 /usr/lib/libXmu.so

/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status
make[1]: *** [../../bin/linux/release/marchingCubes] 오류 1

$ sudo apt-get install libglut3
$ sudo ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so

우분투가 웬수인가.. 어느넘이 웬수인가?

'Programming > openCL & CUDA' 카테고리의 다른 글

deviceQuery on 8600GT 512MB + CUDA 하드웨어 구조  (0) 2011.01.02
CUDA on Linux  (0) 2010.12.07
CUDA / Visual Studio 2008  (2) 2010.12.05
CUDA + Visual Studio 2005  (0) 2010.12.01
nvcc for windows 제약사항?  (0) 2010.11.14
Posted by 구차니