Help with CUDA on RHEL 5.1 Red Hat Enterprise Client 5.1 CUDA

I’m having some difficulty compiling the examples in the SDK on RedHat Enterprise Client 5.1, it looks like my gcc is having problems. any suggestions?
[font=“Courier”]
[ofromberg@silverbullet1 NVIDIA_CUDA_SDK]$ make
make[1]: Entering directory /home/ofromberg/NVIDIA_CUDA_SDK/common' 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 /home/ofromberg/NVIDIA_CUDA_SDK/common’
make[1]: Entering directory /home/ofromberg/NVIDIA_CUDA_SDK/common' a - obj/release/paramgl.cpp_o a - obj/release/param.cpp_o make[1]: Leaving directory /home/ofromberg/NVIDIA_CUDA_SDK/common’
make -C projects/simpleCUFFT/
make[1]: Entering directory /home/ofromberg/NVIDIA_CUDA_SDK/projects/simpleCUFFT' gcc: error trying to exec 'cc1plus': execvp: No such file or directory make[1]: *** [obj/release/simpleCUFFT.cu_o] Error 255 make[1]: Leaving directory /home/ofromberg/NVIDIA_CUDA_SDK/projects/simpleCUFFT’
make: *** [projects/simpleCUFFT/Makefile.ph_build] Error 2
[/font]

gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory

Looks like you don’t have the c++ compiler installed (gcc-c++)

I thought that might have been the problem too, however:

[font=“Courier”][ofromberg@silverbullet1 ~]$ gcc --version

gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright © 2006 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.

[ofromberg@silverbullet1 ~]$ g++ --version

g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-4)

Copyright © 2006 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.[/font]

so I managed to fix this problem by using an older version of gcc:

[font=“Courier”]$ mv /usr/bin/gcc /usr/bin/gcc-backup

$ ln -s gcc34 gcc [/font]

It seems to work now, except I get this problem with libcudart.so:

[font=“Courier”][ofromberg@silverbullet1 NVIDIA_CUDA_SDK]$ make

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

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 `/home/ofromberg/NVIDIA_CUDA_SDK/common’

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

a - obj/release/paramgl.cpp_o

a - obj/release/param.cpp_o

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

make -C projects/simpleCUFFT/

make[1]: Entering directory `/home/ofromberg/NVIDIA_CUDA_SDK/projects/simpleCUFFT’

/usr/local/cuda/lib/libcudart.so: undefined reference to `__cxa_get_exception_ptr@CXXABI_1.3.1’

collect2: ld returned 1 exit status

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

make[1]: Leaving directory `/home/ofromberg/NVIDIA_CUDA_SDK/projects/simpleCUFFT’

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

Other people have had this problem on this forum however I also have this in my .bashrc:

[font=“Courier”]export PATH=$PATH:/usr/local/cuda/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib[/font]

any ideas are appreciated!

You have a version mismatch in your toolchain. You can’t use gcc 4.1.2 with g++ 3.4.6. They must be the same version.

Thanks for your help netllama, but I’ve still got the problem with libcudart.so, see above.

Earlier you stated that you fixed a problem by downgrading gcc. That should not be necessary, and clearly did not resolve the issue. You need to ensure that your entire toolchain is using using the same versioning.

You commented that other people are having the same problem on this forum, however I’m not able to locate any reports of any problems matching what you’ve posted here.

Please answer the following:
0) What is currently the problem that you’re trying to solve?

  1. Is CUDA_1.1 the first (and only) version of CUDA that you’ve installed on this system?
  2. Which display driver did you install?
  3. What is the output from running:
    gcc -v
    g++ -v
    nvcc -V

For some strange reason, my gcc and g++ versions were different, so when I downgraded gcc to 3.4.6 I inadvertently matched their versions together, causing the toolchain versions to match. That solved the problem I was having earlier, however a new problem has arisen. others have also seen this problem as a forum search for “libcudart” will show:

a) http://forums.nvidia.com/index.php?showtop…28&hl=libcudart

B) http://forums.nvidia.com/index.php?showtop…20&hl=libcudart

c) http://forums.nvidia.com/index.php?showtop…06&hl=libcudart

With reference to your (netllama) questions:

  1. when I try to compile the examples in the SDK, I get an error about libcudart.so:

[font=“Courier”][ofromberg@silverbullet1 NVIDIA_CUDA_SDK]$ make

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

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 `/home/ofromberg/NVIDIA_CUDA_SDK/common’

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

a - obj/release/paramgl.cpp_o

a - obj/release/param.cpp_o

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

make -C projects/simpleCUFFT/

make[1]: Entering directory `/home/ofromberg/NVIDIA_CUDA_SDK/projects/simpleCUFFT’

/usr/local/cuda/lib/libcudart.so: undefined reference to `__cxa_get_exception_ptr@CXXABI_1.3.1’

collect2: ld returned 1 exit status

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

make[1]: Leaving directory `/home/ofromberg/NVIDIA_CUDA_SDK/projects/simpleCUFFT’

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

  1. CUDA 1.1 is the first and only CUDA installation.

  2. I installed the beta driver NVIDIA-Linux-x86-169.04-pkg1.run

[font=“Courier”][ofromberg@silverbullet1 NVIDIA_CUDA_SDK]$ gcc -v

Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs

Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=i386-redhat-linux

Thread model: posix

gcc version 3.4.6 20060404 (Red Hat 3.4.6-4)

[ofromberg@silverbullet1 NVIDIA_CUDA_SDK]$ g++ -v

Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs

Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=i386-redhat-linux

Thread model: posix

gcc version 3.4.6 20060404 (Red Hat 3.4.6-4)

[ofromberg@silverbullet1 NVIDIA_CUDA_SDK]$ nvcc -V

nvcc: NVIDIA ® Cuda compiler driver

Copyright © 2005-2006 NVIDIA Corporation

Built on Fri_Nov_30_02:31:29_PST_2007

Cuda compilation tools, release 1.1, V0.2.1221[/font]

thanks for your help!

This is expected behavior, as the CUDA toolkit was built against the default gcc toolchain that ships with a Linux distributions, and you’ve downgraded to a non-default version. The only reason why you would experience the original problem is if parts of your gcc toolchain were not installed.

I managed to solve the problem by compiling and installing gcc 4.1.3. Thanks for your help netllama :D