installing CUDA

Hi everyone,

I’ve installed CUDA 2.3 but when I go to the C directory and make, I get an error saying wrong architecture???

Anyone know what I’ve done wrong.

unknown-00-26-bb-13-26-60:/ anthonymorse$ cd Developer/GPU\ Computing/C/

unknown-00-26-bb-13-26-60:C anthonymorse$ make

make -C src/3DFD/ 

ld: warning: in obj/i386/release/3dfd.cu.o, file is not of required architecture

ld: warning: in /usr/local/cuda/lib/libcudart.dylib, file is not of required architecture

Undefined symbols:

  "_main", referenced from:

	  start in crt1.10.6.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

make[1]: *** [../../bin/darwin/release/3dfd] Error 1

make: *** [src/3DFD/Makefile.ph_build] Error 2

Cheers, cant wait to get this working…

I’ve just read another thread here suggesting that CUDA3.0 would solve this, so I’ve uninstalled and installed CUDA 3.0… Installation goes ok but when I go to the …/GPU Computing/C folder and type make as per the instructions I get this error…

unknown-00-26-bb-13-26-60:C anthonymorse$ sudo make

Password:

a - obj/i386/release/shrUtils.cpp.o

a - obj/i386/release/rendercheckGL.cpp.o

a - obj/i386/release/cmd_arg_reader.cpp.o

make -C src/3DFD/ 

ld: warning: in ../../lib/libcutil_i386.a, file is not of required architecture

make -C src/alignedTypes/ 

ld: warning: in ../../lib/libcutil_i386.a, file is not of required architecture

Undefined symbols:

  "_cutDeleteTimer", referenced from:

	  _main in alignedTypes.cu.o

  "_cutGetTimerValue", referenced from:

	  void runTest<RGBA32>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned char>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32>(int, int)in alignedTypes.cu.o

	  void runTest<LA32>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned int>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned short>(int, int)in alignedTypes.cu.o

  "_cutStartTimer", referenced from:

	  void runTest<RGBA32>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned char>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32>(int, int)in alignedTypes.cu.o

	  void runTest<LA32>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned int>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned short>(int, int)in alignedTypes.cu.o

  "_cutCreateTimer", referenced from:

	  _main in alignedTypes.cu.o

  "_cutGetCmdLineArgumenti", referenced from:

	  _main in alignedTypes.cu.o

  "_cutResetTimer", referenced from:

	  void runTest<RGBA32>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned char>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32>(int, int)in alignedTypes.cu.o

	  void runTest<LA32>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned int>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned short>(int, int)in alignedTypes.cu.o

  "_cutStopTimer", referenced from:

	  void runTest<RGBA32>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned char>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32>(int, int)in alignedTypes.cu.o

	  void runTest<LA32>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned int>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

	  void runTest<unsigned short>(int, int)in alignedTypes.cu.o

  "_cutCheckCmdLineFlag", referenced from:

	  _main in alignedTypes.cu.o

	  _main in alignedTypes.cu.o

	  _main in alignedTypes.cu.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

make[1]: *** [../../bin/darwin/release/alignedTypes] Error 1

make: *** [src/alignedTypes/Makefile.ph_build] Error 2

I should add I’m on a new macbook pro running OSX 10.6.2

As far as I can tell it’s a 64 vs 32 bit problem ‘wrong architecture’ warning but I’m following the basic install instructions so I don’t get this?

Please help

Cuda 2.3 is 32 bit only. So you need to compile in 32 bit. By default Snow Leopard will compile in 64 bit. So you need to enforce it with things like “-m32” or “-arch i386”.

As for Cuda 3.0 I also read on this topic that it was 64 bit. Waiting a confirmation but it didn’t seem to solve your problem so I’m guessing that it’s still 32 bit.

It turns out that things are actually working, at least nvcc works so I can write and compile my own CUDA code. I still cant compile the SDK but I don’t really need that anyway.

I guessed it would be something like -m32 or -arch i386 but this doesn’t seem to work… following the instructions I should be calling ‘make’, which doesn’t let me specify such options.
I’ve had a look in the common.mk file which seems to set up options like this but then changing that to force these options doesn’t effect the make command. I guess I need to re-compile the SDK rather than build it, but I’m not sure how to do that.

Still CUDA is at last working on my mac although without the SDK, and I’ve been playing with it on my Linux desktop too… so far the results have been amazing next step will be to build a PSC with 4 C2050 cards in it :-)