On Mon, Sep 20, 2010 at 8:34 AM, Bryan Catanzaro <catan...@eecs.berkeley.edu > wrote:
> I think it should be changed to check to see if the Python interpreter is > currently running in 32 bit mode, and then compile to match: > > if 'darwin' in sys.platform and sys.maxint == 2147483647: > # The Python interpreter is running in 32 bit mode on OS X > if "-arch" not in conf["CXXFLAGS"]: > conf["CXXFLAGS"].extend(['-arch', 'i386', '-m32']) > if "-arch" not in conf["LDFLAGS"]: > conf["LDFLAGS"].extend(['-arch', 'i386', '-m32']) > > Some people (myself included) have to run Python in 32-bit mode on 64-bit > OS X for various compatibility reasons (currently including libcudart.dylib, > which is only shipped as a 32-bit library). Since the Python which Apple > ships is compiled as a fat binary with both 32 and 64 bit versions, we can't > know a priori what the right compiler flags are. > > - bryan I have driver version 3.1.14 and: $ file /usr/local/cuda/lib/libcudart.dylib /usr/local/cuda/lib/libcudart.dylib: Mach-O universal binary with 2 architectures /usr/local/cuda/lib/libcudart.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /usr/local/cuda/lib/libcudart.dylib (for architecture i386): Mach-O dynamically linked shared library i386 Doesn't that mean it's UB? I can build and test cudamat [1] (which uses ctypes to call libcudart and libcublas) fine in 64-bit macports python though I haven't otherwise used it. I had to make the following small change in it's Makefile: nvcc -O -m 64 -L/usr/local/cuda/lib --ptxas-options=-v --compiler-options '-fPIC' -o libcudamat.so --shared cudamat.cu cudamat_kernels.cu -lcublas from: nvcc -O --ptxas-options=-v --compiler-options '-fPIC' -o libcudamat.so --shared cudamat.cu cudamat_kernels.cu -lcublas I built pycuda as 64-bit and changed pycuda/compiler.py to pass --machine 64 to nvcc and got examples/demo.py to run but the other examples and tests had failures and would eventually hang my machine. I don't know enough to fix this myself but I can try suggestions. Would using 3.2RC make a difference? [1] http://code.google.com/p/cudamat/ cheers, art
_______________________________________________ PyCUDA mailing list PyCUDA@tiker.net http://lists.tiker.net/listinfo/pycuda