CUDA on Fedora 10: Unable to compile

Hi everyone

I’m trying to set up CUDA to work on Fedora Core 10. My hardware config is:

Intel Core i7 920 CPU

3 GB DDR 3 SDRAM (1333 MHz)

Palit GTX 295 Graphics Card (single)

I have downloaded and installed the nVidia driver, which is working fine. The files I have are listed below:

[codebox][vivek@farpoint cuda]$ ls -l

total 107784

-rw-rw-r-- 1 vivek vivek 22619317 2009-05-16 16:39 cudadriver_2.2_linux_32_185.18.08-beta.run

-rw-rw-r-- 1 vivek vivek 1181310 2009-05-16 16:38 cudagdb_2.2_linux_32_rhel5.3.run

-rw-rw-r-- 1 vivek vivek 924289 2009-05-16 16:41 CUDA_Getting_Started_2.2_Linux.pdf

-rw-rw-r-- 1 vivek vivek 48558 2009-05-16 16:37 cudaprof_1.2_readme.html

-rw-rw-r-- 1 vivek vivek 55951278 2009-05-16 16:42 cudasdk_2.2_linux.run

-rw-rw-r-- 1 vivek vivek 28230318 2009-05-16 16:41 cudatoolkit_2.2_linux_32_fedora10.run

-rw-rw-r-- 1 vivek vivek 12476 2009-05-16 16:37 cudatoolkit_eula.txt

-rw-rw-r-- 1 vivek vivek 9414 2009-05-16 16:37 cudatoolkit_release_notes_linux.txt

-rw-rw-r-- 1 vivek vivek 1239966 2009-05-16 16:37 NVIDIA_CUDA_Programming_Guide_2.2.pdf

[vivek@farpoint cuda]$ [/codebox]

I’ve installed the driver, the sdk and then the toolkit with superuser permissions. I have also set the bath in bash_profile. Now, when I log in as root and try to run make, I get the following error messages:

[codebox][root@farpoint NVIDIA_CUDA_SDK]# make

make[1]: Entering directory `/root/NVIDIA_CUDA_SDK/common’

In file included from src/bank_checker.cpp:34:

./…/common/inc/bank_checker.h:52: warning: type qualifiers ignored on function return type

./…/common/inc/bank_checker.h:238: warning: type qualifiers ignored on function return type

src/bank_checker.cpp:75: warning: type qualifiers ignored on function return type

src/bank_checker.cpp:277: warning: type qualifiers ignored on function return type

In file included from ./…/common/inc/stopwatch.h:37,

             from src/cutil.cpp:53:

./…/common/inc/stopwatch_base.h:74: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_base.h:78: warning: type qualifiers ignored on function return type

In file included from ./…/common/inc/stopwatch_base.h:91,

             from ./../common/inc/stopwatch.h:37,

             from src/cutil.cpp:53:

./…/common/inc/stopwatch_base.inl:85: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_base.inl:96: warning: type qualifiers ignored on function return type

In file included from ./…/common/inc/stopwatch.h:44,

             from src/cutil.cpp:53:

./…/common/inc/stopwatch_linux.h:64: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:68: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:144: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:161: warning: type qualifiers ignored on function return type

In file included from src/cutil.cpp:53:

./…/common/inc/stopwatch.h:53: warning: type qualifiers ignored on function return type

In file included from src/cutil.cpp:54:

./…/common/inc/bank_checker.h:52: warning: type qualifiers ignored on function return type

./…/common/inc/bank_checker.h:238: warning: type qualifiers ignored on function return type

In file included from ./…/common/inc/stopwatch.h:37,

             from src/stopwatch.cpp:36:

./…/common/inc/stopwatch_base.h:74: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_base.h:78: warning: type qualifiers ignored on function return type

In file included from ./…/common/inc/stopwatch_base.h:91,

             from ./../common/inc/stopwatch.h:37,

             from src/stopwatch.cpp:36:

./…/common/inc/stopwatch_base.inl:85: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_base.inl:96: warning: type qualifiers ignored on function return type

In file included from ./…/common/inc/stopwatch.h:44,

             from src/stopwatch.cpp:36:

./…/common/inc/stopwatch_linux.h:64: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:68: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:144: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:161: warning: type qualifiers ignored on function return type

In file included from src/stopwatch.cpp:36:

./…/common/inc/stopwatch.h:53: warning: type qualifiers ignored on function return type

src/stopwatch.cpp:89: warning: type qualifiers ignored on function return type

In file included from src/stopwatch_linux.cpp:34:

./…/common/inc/stopwatch_linux.h:64: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:68: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:144: warning: type qualifiers ignored on function return type

./…/common/inc/stopwatch_linux.h:161: warning: type qualifiers ignored on function return type

a - obj/release/bank_checker.cpp.o

a - obj/release/cmd_arg_reader.cpp.o

a - obj/release/cutil.cpp.o

a - obj/release/stopwatch.cpp.o

a - obj/release/stopwatch_linux.cpp.o

a - obj/release/multithreading.cpp.o

make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/common’

make[1]: Entering directory `/root/NVIDIA_CUDA_SDK/common’

make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/common’

make[1]: Entering directory `/root/NVIDIA_CUDA_SDK/common’

make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/common’

make -C projects/bicubicTexture/

make[1]: Entering directory `/root/NVIDIA_CUDA_SDK/projects/bicubicTexture’

bicubicTexture.cpp:106: warning: deprecated conversion from string constant to ‘char*’

bicubicTexture.cpp:136: warning: deprecated conversion from string constant to ‘char*’

bicubicTexture.cpp:703: warning: unused parameter ‘argc’

bicubicTexture.cpp:592: warning: ‘shaderCode’ defined but not used

/usr/bin/ld: cannot find -lglut

collect2: ld returned 1 exit status

make[1]: *** […/…/bin/linux/release/bicubicTexture] Error 1

make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/projects/bicubicTexture’

make: *** [projects/bicubicTexture/Makefile.ph_build] Error 2

[root@farpoint NVIDIA_CUDA_SDK]# [/codebox]

As I’m new to this, can someone please help me figure out the source of the error and correct it.

Thanks!

As root, run:

yum install freeglut-devel

Thanks so much for your help. I can compile now, but when I run deviceQuery, I get the following error message:

[codebox]

[root@farpoint release]# ./deviceQuery

./deviceQuery: error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory

[root@farpoint release]#

[/codebox]

The linker cannot find the CUDA libraries. You need to run:

export LD_LIBRARY_PATH=/usr/local/cuda:${LD_LIBRARY_PATH}

I did that, but I get the same error. I also tried the exact command you mentioned. Here is my .bash_profile listing:

[codebox]

[root@farpoint release]# more ~/.bash_profile

.bash_profile

Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

unset USERNAME

export PATH=$PATH:/usr/local/cuda/bin

export LD_LIBRARY_PATH=/usr/local/cuda:$LD_LIBRARY_PATH

[root@farpoint release]#

[/codebox]

And here’s the error listing:

[codebox]

[root@farpoint release]# export LD_LIBRARY_PATH=/usr/local/cuda:$LD_LIBRARY_PATH

[root@farpoint release]# ./deviceQuery

./deviceQuery: error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory

[root@farpoint release]# export LD_LIBRARY_PATH=/usr/local/cuda:${LD_LIBRARY_PATH}

[root@farpoint release]# ./deviceQuery

./deviceQuery: error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory

[root@farpoint release]#

[/codebox]

Oops, I screwed that up. The libraries are of course in the lib/ directory. That line should have been:

export LD_LIBRARY_PATH=/usr/local/cuda/lib:${LD_LIBRARY_PATH}

Sorry for the confusion.

Awesome, thanks a ton seibert!

[codebox]

[root@farpoint release]# ./deviceQuery

CUDA Device Query (Runtime API) version (CUDART static linking)

There are 2 devices supporting CUDA

Device 0: “GeForce GTX 295”

CUDA Capability Major revision number: 1

CUDA Capability Minor revision number: 3

Total amount of global memory: 938803200 bytes

Number of multiprocessors: 30

Number of cores: 240

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 16384

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.24 GHz

Concurrent copy and execution: Yes

Run time limit on kernels: Yes

Integrated: No

Support host page-locked memory mapping: Yes

Compute mode: Default (multiple host threads can use this device simultaneously)

Device 1: “GeForce GTX 295”

CUDA Capability Major revision number: 1

CUDA Capability Minor revision number: 3

Total amount of global memory: 939261952 bytes

Number of multiprocessors: 30

Number of cores: 240

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 16384

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.24 GHz

Concurrent copy and execution: Yes

Run time limit on kernels: No

Integrated: No

Support host page-locked memory mapping: Yes

Compute mode: Default (multiple host threads can use this device simultaneously)

Test PASSED

Press ENTER to exit…

[root@farpoint release]#

[/codebox]

For the record, I have detailed my experiences on this webpage: http://viveks.wikidot.com/cuda-in-fedora-10. This may be of some use to OP.