Announcement: PyCuda

I am happy to announce the availability of PyCuda, which is a Python wrapper around Cuda. What differentiates it from previous efforts?

    Object cleanup is tied to lifetime of objects. This idiom, often called RAII in C++, makes it much easier to write correct, leak- and crash-free code. PyCuda knows about dependencies, too, so (for example) it won’t detach from a context before all memory allocated in it is also freed.

    Convenience. Abstractions like pycuda.driver.SourceModule and pycuda.gpuarray.GPUArray make CUDA programming even more convenient than with Nvidia’s C-based runtime.

    Completeness. PyCuda puts the full power of CUDA’s driver API at your disposal, if you wish.

    Automatic Error Checking. All CUDA errors are automatically translated into Python exceptions.

    Speed. PyCuda’s base layer is written in C++, so all the niceties above are virtually free.

    Helpful documentation with plenty of examples.

Here’s a link for the PyCuda home page. Also be sure to check out the documentation.

If you run into any issues using the code, don’t hesitate to post here or get in touch.

well that’s funny. We are just started working on a project called jacuda (pre alpha) TODO the same stuff in java :) We wanted to include python support, but now that you have done it, why to reinvent the wheel new :)

http://sourceforge.net/projects/jacuda

good luck with your project!

Another question,

is cuda 2.0Beta really required? Since this keeps us OSX user’s out in the dry :(

The truth of the matter is that I haven’t tried it on any other CUDA. It may well work out of the box on 1.1, I simply don’t know. (and chose to be careful in the announcement)

If it doesn’t, I’d be happy to help you get it to work. Just let me know what breaks–all it should take is a few ifdefs.

Good luck with Jacuda,

Andreas

i give it a try when 'm at work later tonight.

thx!

Wow! This looks great. A nice addition would be integration of the GPUWorker code by MisterAnderson42. This streamlines running tasks on multiple GPUs in the same computer.

See:
http://forums.nvidia.com/index.php?showtop…98&hl=gpuworker

Nice,
Congrats on the release!

Python bindings for CUDA using ctypes can be found at ftp://ftp.graviscom.com/pub/code/python-cuda.
The approach taken is different, trying to emulate original CUDA code more closely. The .tar.gz or .rpm files contain numerous examples, many translated from the CUDA SDK examples.

Great job! Quick question: how do you access the constant memory with PyCuda ?

pycuda.driver.Module.get_global should get you the address, and then you can use any of the memcpy functions.

HTH,

Andreas

Oops. Sorry for the wrong link. Fixed.

Andreas

I’ve looked at the GPUWorker code. I agree that having something like it would be interesting. However, integrating PyCuda and GPUWorker in a straightforward manner would mean significant code duplication. I’m not sure I want to do that at this point. It got me thinking, though, and with the (new) PyCuda v0.90.2, you can pursue a similar strategy from the Python API alone. PyCuda will now release the Python Global Interpreter Lock while waiting on CUDA, which enables other CUDA-using Python threads to run. While this may not be the final answer, it’s at least a step in the multi-GPU direction.

Andreas

ok after a week or so I found finally time and try to compile and install it under osx leopard and cuda 1.1

well sadly it failed.

any ideas?

here is the error message:

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstArray' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_dst_device(CUdeviceptr)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstDevice' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::execute() const':

src/wrapper/wrap_cudadrv.cpp:800: error: 'cuMemcpy3D' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::execute_async(const<unnamed>::stream&) const':

src/wrapper/wrap_cudadrv.cpp:804: error: 'cuMemcpy3DAsync' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: At global scope:

src/wrapper/wrap_cudadrv.cpp:781: error: expected class-name before '{' token

src/wrapper/wrap_cudadrv.cpp: In constructor '<unnamed>::memcpy_3d::memcpy_3d()':

src/wrapper/wrap_cudadrv.cpp:784: error: 'reserved0' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:785: error: 'reserved1' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:787: error: 'srcXInBytes' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:788: error: 'srcY' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:789: error: 'srcZ' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:791: error: 'dstXInBytes' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:792: error: 'dstY' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:793: error: 'dstZ' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_src_host(boost::python::api::object)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'srcMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'srcHost' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_src_array(const<unnamed>::array&)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'srcMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'srcArray' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_src_device(CUdeviceptr)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'srcMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'srcDevice' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_dst_host(boost::python::api::object)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstHost' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_dst_array(const<unnamed>::array&)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstArray' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::set_dst_device(CUdeviceptr)':

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstMemoryType' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:796: error: 'dstDevice' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::execute() const':

src/wrapper/wrap_cudadrv.cpp:800: error: 'cuMemcpy3D' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In member function 'void<unnamed>::memcpy_3d::execute_async(const<unnamed>::stream&) const':

src/wrapper/wrap_cudadrv.cpp:804: error: 'cuMemcpy3DAsync' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In function 'void init_module__driver()':

src/wrapper/wrap_cudadrv.cpp:947: error: 'CUctx_flags' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:947: error: template argument 1 is invalid

src/wrapper/wrap_cudadrv.cpp:948: error: 'CU_CTX_SCHED_AUTO' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:949: error: 'CU_CTX_SCHED_SPIN' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:950: error: 'CU_CTX_SCHED_YIELD' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:951: error: 'CU_CTX_SCHED_MASK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:952: error: 'CU_CTX_FLAGS_MASK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:983: error: 'CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:988: error: 'CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:994: error: 'CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp: In function 'void init_module__driver()':

src/wrapper/wrap_cudadrv.cpp:947: error: 'CUctx_flags' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:947: error: template argument 1 is invalid

src/wrapper/wrap_cudadrv.cpp:948: error: 'CU_CTX_SCHED_AUTO' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:949: error: 'CU_CTX_SCHED_SPIN' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:950: error: 'CU_CTX_SCHED_YIELD' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:951: error: 'CU_CTX_SCHED_MASK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:952: error: 'CU_CTX_FLAGS_MASK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:983: error: 'CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:988: error: 'CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:994: error: 'CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1159: error: 'srcXInBytes' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1160: error: 'srcY' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1161: error: 'srcZ' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1162: error: 'srcLOD' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1163: error: 'srcMemoryType' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1164: error: 'srcDevice' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1165: error: 'srcPitch' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1159: error: 'srcXInBytes' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1160: error: 'srcY' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1161: error: 'srcZ' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1162: error: 'srcLOD' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1166: error: 'srcHeight' is not a member of 'init_module__driver()::cl'src/wrapper/wrap_cudadrv.cpp:1163: error: 'srcMemoryType' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1164: error: 'srcDevice' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1165: error: 'srcPitch' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1166: error: 'srcHeight' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1172: error: 'dstXInBytes' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1173: error: 'dstY' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1174: error: 'dstZ' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1175: error: 'dstLOD' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1172: error: 'dstXInBytes' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1176: error: 'dstMemoryType' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1173: error: 'dstY' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1177: error: 'dstDevice' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1178: error: 'dstPitch' is not a member of 'init_module__driver()::cl'src/wrapper/wrap_cudadrv.cpp:1174: error: 'dstZ' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1179: error: 'dstHeight' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1175: error: 'dstLOD' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1176: error: 'dstMemoryType' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1177: error: 'dstDevice' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1185: error: 'WidthInBytes' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1178: error: 'dstPitch' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1186: error: 'Height' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1179: error: 'dstHeight' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1187: error: 'Depth' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1185: error: 'WidthInBytes' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1186: error: 'Height' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1187: error: 'Depth' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1221: error: 'CUDA_ARRAY3D_DESCRIPTOR' does not name a type

src/wrapper/wrap_cudadrv.cpp:1222: error: 'cl' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1222: error: template argument 1 is invalid

src/wrapper/wrap_cudadrv.cpp:1223: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1223: error: 'Width' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1224: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1224: error: 'Height' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1225: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1225: error: 'Depth' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1226: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1226: error: 'Format' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1227: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1227: error: 'NumChannels' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1221: error: 'CUDA_ARRAY3D_DESCRIPTOR' does not name a type

src/wrapper/wrap_cudadrv.cpp:1222: error: 'cl' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1222: error: template argument 1 is invalid

src/wrapper/wrap_cudadrv.cpp:1223: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1223: error: 'Width' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1224: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1224: error: 'Height' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1225: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1225: error: 'Depth' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1226: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1226: error: 'Format' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1227: error: 'cl' is not a class or namespace

src/wrapper/wrap_cudadrv.cpp:1227: error: 'NumChannels' was not declared in this scope

src/wrapper/wrap_cudadrv.cpp:1235: error: ISO C++ forbids declaration of 'type name' with no type

src/wrapper/wrap_cudadrv.cpp:1235: error: missing '>' to terminate the template argument list

src/wrapper/wrap_cudadrv.cpp:1235: error: template argument 1 is invalid

src/wrapper/wrap_cudadrv.cpp:1237: error: 'get_descriptor_3d' is not a member of 'init_module__driver()::cl'

src/wrapper/wrap_cudadrv.cpp:1235: error: ISO C++ forbids declaration of 'type name' with no type

src/wrapper/wrap_cudadrv.cpp:1235: error: missing '>' to terminate the template argument list

src/wrapper/wrap_cudadrv.cpp:1235: error: template argument 1 is invalid

src/wrapper/wrap_cudadrv.cpp:1237: error: 'get_descriptor_3d' is not a member of 'init_module__driver()::cl'

lipo: can't open input file: /var/tmp//cczt266y.out (No such file or directory)

error: command 'gcc' failed with exit status 1

make: *** [install] Error 1

Try a recent git checkout. It contains compatibility code to deal with CUDA 1.1. If you don’t have git, you can download a snapshot from here.

Andreas

Yeah! Finally I managed to make PyCuda work on winxp.

All tests pass. Only test_gpuarray_speed.py says

Fatal Python error: PyEval_RestoreThread: NULL tstate

for some reason after showing charts.

I use:

  • cuda toolkit 2.0

  • msvc 7.1

  • python 2.5

  • boost 1.35.0

There were some issues with wrapping __stdcall function with boost.python. I solved them by writing cdecl wrappers like

CUresult  _cuMemsetD8( CUdeviceptr dstDevice, unsigned char uc, unsigned int N ) { return cuMemsetD8( dstDevice, uc, N ); }

Is there a better way to do it?

Here is my modified version of wrap_cudadrv.cpp

Also I think it would be nice to have some kind of cubin cache to avoid unmodified kernel compilation on every launch of the script.

wrap_cudadrv.cpp (35.9 KB)

Define BOOST_BIND_ENABLE_STDCALL in the compiler settings. It enables boost::bind support for stdcall. Only define this for 32-bit builds, though. stdcall is automatically turned into cdecl on 64-bit windows causing multiply defined symbols in a boost header file when BOOST_BIND_ENABLE_STDCALL is defined.

Tried to this, but the problem is still here.

My Jamroot file:

# Specify the path to the Boost project.  If you move this project,

# adjust the path to refer to the Boost root directory.

use-project boost 

   : c:/dev/sdk/boost_1_35_0;

#  : ../../../..;

# Set up the project-wide requirements that everything uses the

# boost_python library defined in the project whose global ID is

# /boost/python.

project boost-python-quickstart

  : requirements 

    <library>/boost/python//boost_python

    <include>c:/cuda/include

    <include>C:/Python25/Lib/site-packages/numpy/core/include/

    <library>c:/cuda/lib/cuda.lib

   ;

# Make the definition of the python-extension rule available

import python;

# Declare a Python extension called hello.

python-extension _driver : wrap_cudadrv.cpp 

  : 

    <define>BOOST_BIND_ENABLE_STDCALL

 ;

hello and thx for your response, sadly it failed again. And sofar I noticed:

  • unsupported ctags flag (-R) under osx/bsd
ctags -R src || true

ctags: illegal option -- R

usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
  • it seems to have problems with the boost library, since it reports missing files.
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -Wall -O3 -DNDEBUG -arch i386 -arch ppc -pipe -I/usr/local/boost/include/ -I/usr/local/cuda/include -I/Library/Python/2.5/site-packages/numpy-1.1.0-py2.5-macosx-10.5-i386.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/wrapper/wrap_cudadrv.cpp -o build/temp.macosx-10.5-i386-2.5/src/wrapper/wrap_cudadrv.o

In file included from src/wrapper/wrap_cudadrv.cpp:8:

src/wrapper/wrap_helpers.hpp:7:28: error: boost/python.hpp: No such file or directory

src/wrapper/wrap_cudadrv.cpp:9:41: error: boost/python/stl_iterator.hpp: No such file or directory

src/wrapper/wrap_cudadrv.cpp:10:32: error: boost/shared_ptr.hpp: No such file or directory

src/wrapper/wrap_cudadrv.cpp:11:30: error: boost/weak_ptr.hpp: No such file or directory

I attached the complete errorlog.
errorLog.rtf (138 KB)

ok we are making progress after some more coffee one of the problems disappeared after I modified the generated config file by hand.

[b]fry:pycuda.git wohlgemuth$ cat siteconf.py

[/b]

BOOST_INC_DIR = ['/usr/local/boost/include/boost-1_35']

BOOST_LIB_DIR = ['/usr/local/boost/lib']

BOOST_PYTHON_LIBNAME = ['boost_python-mt-1_35']

CUDA_ROOT = '/usr/local/cuda/'

CUDADRV_LIB_DIR = ['/usr/local/cuda/lib']

CUDADRV_LIBNAME = ['cuda']

CXXFLAGS = []

LDFLAGS = []

Now I was able to compile pycuda, but sadly the quest is not done yet and it complain with a couple of warnings.

creating build/temp.macosx-10.5-i386-2.5/src/wrapper

gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -Wall -O3 -DNDEBUG -arch i386 -arch ppc -pipe -I/usr/local/boost/include/boost-1_35 -I/usr/local/cuda/include -I/Library/Python/2.5/site-packages/numpy-1.1.0-py2.5-macosx-10.5-i386.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/wrapper/wrap_cudadrv.cpp -o build/temp.macosx-10.5-i386-2.5/src/wrapper/wrap_cudadrv.o

g++ -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc build/temp.macosx-10.5-i386-2.5/src/wrapper/wrap_cudadrv.o -L/usr/local/boost/lib -L/usr/local/cuda/lib -lboost_python-mt-1_35 -lcuda -o build/lib.macosx-10.5-i386-2.5/pycuda/_driver.so

ld: warning in /usr/local/boost/lib/libboost_python-mt-1_35.dylib, file is not of required architecture

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

I guess it’s related to the flag “-arch i386” or “-arch ppc”. I try to track it down.

if we ignore this warning we will not be able to run the tests

[b]fry:test wohlgemuth$ python test_driver.py

[/b]

Traceback (most recent call last):

  File "test_driver.py", line 2, in <module>

    import pycuda.driver as drv

  File "/Library/Python/2.5/site-packages/pycuda-0.90.2-py2.5-macosx-10.5-i386.egg/pycuda/driver.py", line 1, in <module>

    from _driver import *

ImportError: dlopen(/Library/Python/2.5/site-packages/pycuda-0.90.2-py2.5-macosx-10.5-i386.egg/pycuda/_driver.so, 2): Symbol not found: _cuCtxGetDevice

  Referenced from: /Library/Python/2.5/site-packages/pycuda-0.90.2-py2.5-macosx-10.5-i386.egg/pycuda/_driver.so

  Expected in: dynamic lookup

ok i got it now to compile without warnings after changing the config file to

BOOST_INC_DIR = ['/usr/local/boost/include/boost-1_35']

BOOST_LIB_DIR = ['/usr/local/boost/lib']

BOOST_PYTHON_LIBNAME = ['boost_python-mt-1_35']

CUDA_ROOT = '/usr/local/cuda/'

CUDADRV_LIB_DIR = ['/usr/local/cuda/lib']

CUDADRV_LIBNAME = ['cuda']

CXXFLAGS = ['-arch', 'i386']

LDFLAGS = ['-arch', 'i386']

but the tests sadly keep failing :(

The ctags issue was fixed with installing the newest ctags version, as explained here

http://adamyoung.net/Exuberant-Ctags-OS-X

Cosmin Stejerean just found out the same thing, see this post.

Incidentally, I would like to announce that PyCuda now has a mailing list.

Maybe you guys can coordinate your efforts there.

Andreas