I’ve just installed Fedora 11 on one of my development machines (x84_64), along with the 185.18.14 drivers and the Cuda 2.2 toolkits and sdks. Unfortunately, most of the example targets in the sdk fail because of an error:
/usr/local/cuda/bin/…/include/math_functions.h:404: error: inline function ‘int __signbit(double)’ cannot be declared weak
/usr/local/cuda/bin/…/include/math_functions.h:409: error: inline function ‘int __signbitf(float)’ cannot be declared weak
Fedora 11 comes with gcc 4.4, which I think is the problem - I actually installed the Fedora 10 versions of the toolkit & SDK because those appeared to be the most recent.
I understand from a forum post back in March 30, 2009 in these forums that GCC 4.4 is not supported yet. Can I get some information about plans to support the newer compiler? I’d be happy to help out with testing, etc.
It took us a while to support gcc 4.3, so I imagine gcc 4.4 will take a while too. (the idea that people would deploy on gcc 4.4 right now boggles me a little)
Using the nvcc’s --compiler-bindir option and compat-gcc-34 package, it is possible to build the SDK. But the cuda device detection always fail. Is it the expected result on fedora 11 or a problem with my configuration?
While Fedora 11 has not received any official testing with CUDA, it seems unlikely that device detection would fail if the driver were correctly installed. I’m guessing that something more fundamental isn’t setup correctly on your system. Generating and attaching an nvidia-bug-report.log.gz would be helpful.
Anyway, I built gcc 4.3.3 (which takes a while, BTW) and coered nvcc to use it, and everything works fine. I don’t need to use any gcc 4.4 features right now, especially in my CUDA programs…
Ok, thank you. Here it is. I use drivers from the rpmfusion repository and cudatoolkit2.1. Launching ./deviceQuery returns:
cudaSafeCall() Runtime API error in file <deviceQuery.cu>, line 59 : feature is not yet implemented.
I have tried with cuda2.2 and rpmfusion testing which has 185 drivers and this program returns emulation only device. xorg.conf.gz (251 Bytes) nvidia_bug_report.log.gz (32.2 KB)
After investigation, cudart try to dlopen libcuda.so but because I didn’t install xorg-x11-drv-nvidia-devel.x86_64 (which provides libcuda.so) it gives me this strange error. Maybe a more obvious error message could be used.
It leads to another question: cudart is looking for libcuda.so which is the name used at linking time (by convention) whereas libcuda.so.1 is the runtime library name. Maybe it should use libcuda.so.1? (and thus being compatible with rpmfusion packaging standards)
I’m not an expert in library naming, so I may miss something.
libcuda is the actual CUDA driver. If you’re opting not to use the official NVIDIA driver package (which provides all the drivers), then you’re at the whim of how the 3rd party packagers choose to put things together.
Yeah I found that the version in Fusion wasn’t new enough to be supported by the latest Cuda toolkit - I installed the newest drivers from the nvidia website and it works fine (with gcc 4.3)
To compile the sample-projects on F11 w/gcc34 you can change the VIDIA_CUDA_SDK/common/common.mk lines:
CXX := g++34
CC := gcc34
LINK := g++34 -fPIC
and
NVCCFLAGS := --compiler-bindir /tmp
Then create a symbolic link in /tmp:
ln -s /usr/bin/gcc34 gcc
as was advised - this worked nearly for all examples ::
To compile the sample-projects on F11 w/gcc34 you can change the VIDIA_CUDA_SDK/common/common.mk lines:
CXX := g++34
CC := gcc34
LINK := g++34 -fPIC
and
NVCCFLAGS := --compiler-bindir /tmp
Then create a symbolic link in /tmp:
ln -s /usr/bin/gcc34 /tmp/gcc
1- It does not fix the [font=“Courier New”]“__sync_fetch_and_add is undefined”[/font] problem. If you read the messages in order, it might be interpreted that it will.
2- The changes are done against the cuda3.0beta release. The line numbers mentioned do not correspond to CUDA 2.3. The “1.” step is just the commenting out of the __signbit* calls mentioned elsewhere. The “2.” step is the modification of the make rule to find and replace those functions…
I am still waiting for the __sync_fetch_and_add fix, but it seems like a fundamental gcc 4.4 assembly implementation issue.
CUDA on GCC 4.4 is easy. I did a full article about this a little while ago here: CUDA in GCC 4.4 solved
The summary of the post is this though, it’s easily do-able with some small modifications to the SDK code. Here’s the quicky on it:
In math_functions.h comment out (please excuse to poor copy and paste formatting):
in common_functions.h comment out:
You might get another library error though. Hopefully not. Good luck though! Though I’m not 100% sure that the line numbers are exact. I got them from my install on Kubunty 9.10 … so I don’t really know what changes if anything. The line numbers aren’t as important as the code you have to comment out.
Anyway, after commenting out that code in those two files it should compile.