CUDA 4.0RC on OpenSuSE 11.3 Compiling SDK samples
I downloaded everything related to CUDA 4.0RC, the files for OpenSuSE 11.2 and started compiling the SDK samples under OpenSuSE 11.3, stymied by

error -- unsupported GNU version! gcc 4.5 and up are not supported!

I then went ahead and 'fixed' line 81 in /usr/local/cuda64/cuda/include/host_config.h as shown below.

[code]
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
//#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)
[/code]

Everything compiled well, except for 3 files, Interval, FunctionPointers and SobelFilter.

It would be nice, if those doing testing at NVIDIA would consider to include gcc 4.5 as a supported version. 4.5 is not exactly bleeding edge any longer.
I downloaded everything related to CUDA 4.0RC, the files for OpenSuSE 11.2 and started compiling the SDK samples under OpenSuSE 11.3, stymied by



error -- unsupported GNU version! gcc 4.5 and up are not supported!



I then went ahead and 'fixed' line 81 in /usr/local/cuda64/cuda/include/host_config.h as shown below.





#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)

//#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)




Everything compiled well, except for 3 files, Interval, FunctionPointers and SobelFilter.



It would be nice, if those doing testing at NVIDIA would consider to include gcc 4.5 as a supported version. 4.5 is not exactly bleeding edge any longer.

#1
Posted 03/07/2011 11:09 AM   
[b]*sigh*[/b]

I haven't had time to install CUDA 4.0rc yet, but this does not surprise me at all. Everytime there's a new version of CUDA, it's only working with gcc <= n-1, where n is the current gcc version.

Here is what I usually do:
- in parallel to the current gcc version (currently 4.5.2 on Arch Linux), install an older one. Right now I have 4.3.4 and 4.4.4, available as "gcc-4.3" and "gcc-4.4".
- for each of these old compilers, create a folder, say /opt/gcc43 and /opt/gcc44, which contain symlinks to /usr/bin/g{cc,++}-4.{3,4} that are named "gcc" and "g++" [b]without version numbers[/b]
- run nvcc with the --compiler-bindir option: "nvcc --compiler-bindir /opt/gcc44 $CUFLAGS ..."

This has worked well so far.

But I agree, people at NVIDIA should [b]really[/b] consider upgrading their own gcc versions. gcc 4.5.0 has been released on April 14th, 2010 -- that's almost one year! And gcc 4.6.0 is in stage 4, so it won't be long before it is released too...
*sigh*



I haven't had time to install CUDA 4.0rc yet, but this does not surprise me at all. Everytime there's a new version of CUDA, it's only working with gcc <= n-1, where n is the current gcc version.



Here is what I usually do:

- in parallel to the current gcc version (currently 4.5.2 on Arch Linux), install an older one. Right now I have 4.3.4 and 4.4.4, available as "gcc-4.3" and "gcc-4.4".

- for each of these old compilers, create a folder, say /opt/gcc43 and /opt/gcc44, which contain symlinks to /usr/bin/g{cc,++}-4.{3,4} that are named "gcc" and "g++" without version numbers

- run nvcc with the --compiler-bindir option: "nvcc --compiler-bindir /opt/gcc44 $CUFLAGS ..."



This has worked well so far.



But I agree, people at NVIDIA should really consider upgrading their own gcc versions. gcc 4.5.0 has been released on April 14th, 2010 -- that's almost one year! And gcc 4.6.0 is in stage 4, so it won't be long before it is released too...

#2
Posted 03/10/2011 02:34 PM   
The reason for not supporting gcc 4.5 yet was laid out in another thread. gcc 4.5 switches to DWARF3 frame format, so supporting it doesn't just involve making the toolkit and nvcc emitted code play nicely with the compiler, it involves a complete overhaul of the cuda elf and binutils and cuda-gdb as well. Right none of that will work with gcc 4.5.
The reason for not supporting gcc 4.5 yet was laid out in another thread. gcc 4.5 switches to DWARF3 frame format, so supporting it doesn't just involve making the toolkit and nvcc emitted code play nicely with the compiler, it involves a complete overhaul of the cuda elf and binutils and cuda-gdb as well. Right none of that will work with gcc 4.5.

#3
Posted 03/10/2011 02:43 PM   
[quote name='Schnouki' date='10 March 2011 - 08:34 AM' timestamp='1299767647' post='1205324']
But I agree, people at NVIDIA should [b]really[/b] consider upgrading their own gcc versions. gcc 4.5.0 has been released on April 14th, 2010 -- that's almost one year! And gcc 4.6.0 is in stage 4, so it won't be long before it is released too...
[/quote]

NVIDIA doesn't directly target GCC versions. They target specific Linux distributions and the default gcc that ships with them. Since the 4.0 toolkit is only tested for Ubuntu 10.10, Fedora 13, OpenSUSE 11.2, etc, they only "have" to support gcc 4.4. (In the past this was not enforced with pre-processor directives, though. Have they been getting a bunch of bug reports from people using non-standard gcc versions??)

However, I do agree it can be a little annoying that the 4-6 month release cycle of CUDA is always going to be out of phase and one step behind the 6 month release cycle of the non-enterprise distros. It does seem weird that CUDA 4.0 is still targeting OpenSUSE 11.2, when 11.3 has been out for 3 months longer than Ubuntu 10.10. That seems like an oversight, or some more interesting problem.
[quote name='Schnouki' date='10 March 2011 - 08:34 AM' timestamp='1299767647' post='1205324']

But I agree, people at NVIDIA should really consider upgrading their own gcc versions. gcc 4.5.0 has been released on April 14th, 2010 -- that's almost one year! And gcc 4.6.0 is in stage 4, so it won't be long before it is released too...





NVIDIA doesn't directly target GCC versions. They target specific Linux distributions and the default gcc that ships with them. Since the 4.0 toolkit is only tested for Ubuntu 10.10, Fedora 13, OpenSUSE 11.2, etc, they only "have" to support gcc 4.4. (In the past this was not enforced with pre-processor directives, though. Have they been getting a bunch of bug reports from people using non-standard gcc versions??)



However, I do agree it can be a little annoying that the 4-6 month release cycle of CUDA is always going to be out of phase and one step behind the 6 month release cycle of the non-enterprise distros. It does seem weird that CUDA 4.0 is still targeting OpenSUSE 11.2, when 11.3 has been out for 3 months longer than Ubuntu 10.10. That seems like an oversight, or some more interesting problem.

#4
Posted 03/10/2011 02:51 PM   
[quote name='avidday' date='10 March 2011 - 03:43 PM' timestamp='1299768227' post='1205329']
The reason for not supporting gcc 4.5 yet was laid out in another thread. gcc 4.5 switches to DWARF3 frame format, so supporting it doesn't just involve making the toolkit and nvcc emitted code play nicely with the compiler, it involves a complete overhaul of the cuda elf and binutils and cuda-gdb as well. Right none of that will work with gcc 4.5.
[/quote]

Thanks for this explanation. I had missed that thread, but this makes perfectly sense.

Well, I'll keep my gcc-4.3 and 4.4 around for a little longer then :)
[quote name='avidday' date='10 March 2011 - 03:43 PM' timestamp='1299768227' post='1205329']

The reason for not supporting gcc 4.5 yet was laid out in another thread. gcc 4.5 switches to DWARF3 frame format, so supporting it doesn't just involve making the toolkit and nvcc emitted code play nicely with the compiler, it involves a complete overhaul of the cuda elf and binutils and cuda-gdb as well. Right none of that will work with gcc 4.5.





Thanks for this explanation. I had missed that thread, but this makes perfectly sense.



Well, I'll keep my gcc-4.3 and 4.4 around for a little longer then :)

#5
Posted 03/10/2011 02:53 PM   
[quote name='Schnouki' date='10 March 2011 - 07:34 AM' timestamp='1299767647' post='1205324']
Here is what I usually do:
- in parallel to the current gcc version (currently 4.5.2 on Arch Linux), install an older one. Right now I have 4.3.4 and 4.4.4, available as "gcc-4.3" and "gcc-4.4".
- for each of these old compilers, create a folder, say /opt/gcc43 and /opt/gcc44, which contain symlinks to /usr/bin/g{cc,++}-4.{3,4} that are named "gcc" and "g++" [b]without version numbers[/b]
- run nvcc with the --compiler-bindir option: "nvcc --compiler-bindir /opt/gcc44 $CUFLAGS ..."

This has worked well so far.

[/quote]
I'm having the same problem under Fedora 14. I tried finding an RPM package for Fedora 14 for a 4.4 version of gcc, but could only find old links that no longer linked to packages. I downloaded a package built for Fedora 13 (gcc-4.4.4-2.fc13.x86_64.rpm) and tried to install that, but got:

rpm -ivh gcc-4.4.4-2.fc13.x86_64.rpm
warning: gcc-4.4.4-2.fc13.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID e8e40fde: NOKEY
error: Failed dependencies:
cpp = 4.4.4-2.fc13 is needed by gcc-4.4.4-2.fc13.x86_64
libgomp = 4.4.4-2.fc13 is needed by gcc-4.4.4-2.fc13.x86_64

At this point, I'm afraid I'm embarking down a dependency cascade, and wonder if it wouldn't be easier to simply install Fedora 13. Does anyone have it working under Fedora 14, and if so, can you advise? I don't really feel up to building gcc 4.4 from source.

ETA: Went ahead and backed off to Fedora 13 and gcc 4.4.5, and everything is working for me as of May 1, 2011.
[quote name='Schnouki' date='10 March 2011 - 07:34 AM' timestamp='1299767647' post='1205324']

Here is what I usually do:

- in parallel to the current gcc version (currently 4.5.2 on Arch Linux), install an older one. Right now I have 4.3.4 and 4.4.4, available as "gcc-4.3" and "gcc-4.4".

- for each of these old compilers, create a folder, say /opt/gcc43 and /opt/gcc44, which contain symlinks to /usr/bin/g{cc,++}-4.{3,4} that are named "gcc" and "g++" without version numbers

- run nvcc with the --compiler-bindir option: "nvcc --compiler-bindir /opt/gcc44 $CUFLAGS ..."



This has worked well so far.





I'm having the same problem under Fedora 14. I tried finding an RPM package for Fedora 14 for a 4.4 version of gcc, but could only find old links that no longer linked to packages. I downloaded a package built for Fedora 13 (gcc-4.4.4-2.fc13.x86_64.rpm) and tried to install that, but got:



rpm -ivh gcc-4.4.4-2.fc13.x86_64.rpm

warning: gcc-4.4.4-2.fc13.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID e8e40fde: NOKEY

error: Failed dependencies:

cpp = 4.4.4-2.fc13 is needed by gcc-4.4.4-2.fc13.x86_64

libgomp = 4.4.4-2.fc13 is needed by gcc-4.4.4-2.fc13.x86_64



At this point, I'm afraid I'm embarking down a dependency cascade, and wonder if it wouldn't be easier to simply install Fedora 13. Does anyone have it working under Fedora 14, and if so, can you advise? I don't really feel up to building gcc 4.4 from source.



ETA: Went ahead and backed off to Fedora 13 and gcc 4.4.5, and everything is working for me as of May 1, 2011.

#6
Posted 04/24/2011 09:16 PM   
Hi there! I tried to follow your post, but I got error. What am I wrong?

sander@matrixps:~/CUDA_codes/testes$ ls -l /opt/gcc/
total 0
lrwxrwxrwx 1 root root 16 2011-08-16 14:30 g++ -> /usr/bin/g++-4.4
lrwxrwxrwx 1 root root 16 2011-08-16 14:30 gcc -> /usr/bin/gcc-4.4
sander@matrixps:~/CUDA_codes/testes$ nvcc --compiler-bindir /opt/gcc trivial.cu -o trivial
sander@matrixps:~/CUDA_codes/testes$ ./trivial
CUDA error: CUDA driver version is insufficient for CUDA runtime version
sander@matrixps:~/CUDA_codes/testes$ more trivial.cu
#include <stdio.h>

__global__ void foo()
{}
int main()
{
foo<<<1,1>>>();
printf("CUDA error: %s\n", cudaGetErrorString(cudaGetLastError()));
return 0;
}
sander@matrixps:~/CUDA_codes/testes$ echo $PATH
/usr/local/cuda/bin:/home/sander/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
sander@matrixps:~/CUDA_codes/testes$ echo $LD_LIBRARY_PATH
/usr/local/cuda/lib64:/usr/lib32/nvidia-current:
sander@matrixps:~/CUDA_codes/testes$
Hi there! I tried to follow your post, but I got error. What am I wrong?



sander@matrixps:~/CUDA_codes/testes$ ls -l /opt/gcc/

total 0

lrwxrwxrwx 1 root root 16 2011-08-16 14:30 g++ -> /usr/bin/g++-4.4

lrwxrwxrwx 1 root root 16 2011-08-16 14:30 gcc -> /usr/bin/gcc-4.4

sander@matrixps:~/CUDA_codes/testes$ nvcc --compiler-bindir /opt/gcc trivial.cu -o trivial

sander@matrixps:~/CUDA_codes/testes$ ./trivial

CUDA error: CUDA driver version is insufficient for CUDA runtime version

sander@matrixps:~/CUDA_codes/testes$ more trivial.cu

#include <stdio.h>



__global__ void foo()

{}

int main()

{

foo<<<1,1>>>();

printf("CUDA error: %s\n", cudaGetErrorString(cudaGetLastError()));

return 0;

}

sander@matrixps:~/CUDA_codes/testes$ echo $PATH

/usr/local/cuda/bin:/home/sander/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

sander@matrixps:~/CUDA_codes/testes$ echo $LD_LIBRARY_PATH

/usr/local/cuda/lib64:/usr/lib32/nvidia-current:

sander@matrixps:~/CUDA_codes/testes$

#7
Posted 08/16/2011 05:53 PM   
lol, it`s a little bit offtopic, but when i trying to install PyCUDA on SLES SP1, i realized that there is no libcuda.so file. After all, i found that there is need in installation kernel devel rpm package before you install nvidia-devel driver. Then libcuda.so suddenly appears in /usr/lib64/. Or maybe this file appears after reinstalling SDK after driver.
After all PyCUDA installed.
lol, it`s a little bit offtopic, but when i trying to install PyCUDA on SLES SP1, i realized that there is no libcuda.so file. After all, i found that there is need in installation kernel devel rpm package before you install nvidia-devel driver. Then libcuda.so suddenly appears in /usr/lib64/. Or maybe this file appears after reinstalling SDK after driver.

After all PyCUDA installed.

#8
Posted 08/18/2011 09:10 AM   
For Suse (and pretty much the same for Fedora) please see some helpful hints I compiled at:

http://timelordz.com/wiki/Nvidia_CUDA

Under the section GCC Version Issues, which shows how to install gcc 4.5, 4.3 and configure update-alternatives for easy switching. The same applies to adding gcc 4.4

Pete
For Suse (and pretty much the same for Fedora) please see some helpful hints I compiled at:



http://timelordz.com/wiki/Nvidia_CUDA



Under the section GCC Version Issues, which shows how to install gcc 4.5, 4.3 and configure update-alternatives for easy switching. The same applies to adding gcc 4.4



Pete

#9
Posted 08/23/2011 08:23 PM   
Scroll To Top