here’s a summary of what needs to be done to get CUDA 2.3 working nice on Snow Leopard.
I did not find out this stuff, I’m just summing up the stuff gathered from various other forum posts.
NVCC is not compatible with gcc and g++ 4.2, but these are the default compilers on Snow Leopard and nvcc uses the defaults.
The solution is to make versions 4.0 the system defaults again (as was the case with Leopard)
To remove the symbolic links to versions 4.2 and re-create the links to versions 4.0 execute:
CUDA is not yet capable of 64bit development under OS X, but it looks like the compilers now default to creating 64bit code.
To prevent that, the parameter -m32 needs to be passed to all compilers (gcc, g++ and nvcc).
In order to build the CUDA SDK samples on SL, the following adjustments are needed to the SDKs common make file:
Edit /Developer/GPU Computing/C/common/common.mk
CXXFLAGS := (CXXWARN_FLAGS)
CFLAGS := (CWARN_FLAGS)
Need to be changed to
NVCCFLAGS := -m32
CXXFLAGS := -m32 (CXXWARN_FLAGS)
CFLAGS := -m32 (CWARN_FLAGS)
Due to a bug in the CUDA Driver (or Toolkit?) installer, some permissions are not correctly set, which prevents the CUDA kernel extension from being loaded after a system restart.
Hopefully that’s all - but actually I messed so much with my system lately that I cannot be sure I didn’t miss something.
So if CUDA still does not work please give feedback here so we can adjust/expand this summary.
FIX 4: (added 10.Sept.09)
Wrong permissions on the “/usr/local/cuda/lib” folder
This one seems to happen under some circumstances only - on 5 CUDA installs it happened to me once. Anyway, after installing the CUDA driver and toolkit make sure check if this folder does can be read by all users.
Yes, I think NVIDIA is doing a little mess with the OpenGL headers.
Under OS X glew, glu, glut are all shipped with the system but the CUDA SDK ships and uses with it’s own copies of those. So probably you’ll run into trouble if you create an app that uses both the Mac headers AND the SDK common includes. Is that the case? Do the SDK samples (that use OpenGL) compile?
No idea. Did you try ‘make clean’ and then ‘make’?
The examples do compile, however none of them use glx.h, and it seems that nVidia isn’t distributing it. glx.h in turn includes gl.h, which then causes the issue. Not really sure what I can do about this, but this is COMPLETELY killing my productivity at this point.
This was definitely working perfectly under 10.5, and only became a problem in Snow Leopard. The code in question is multi-platform, so I’m not sure if I can change it without causing issues on other platforms.
I might be able to do massive #ifdefs, but that definitely won’t be pretty.
Anyhow, I do appreciate the input, and I’ll at least take a gander and see if it might be feasible. As you might imagine, it’s just frustrating to have a lot of work created by something that was previously working perfectly.