Hello Per - very clear steps. I'd encourage you to update the wiki (no
registration required) as more Snow Leopard users will be coming along
all the time:
http://wiki.tiker.net/PyCuda/Installation/Mac

I did the same for Windows a few months back...

Ian.

On 20 April 2010 15:15, Per B. Sederberg <psederb...@gmail.com> wrote:
> Hi Cyrus and Ian:
>
> Although it is not ideal and it took me many hours to figure out (as
> opposed to the 5 minutes it takes on Debian), I've been able to get
> PyCUDA and CUDA 3.0 working with 32-bit Enthought Python on Snow
> Leopard.
>
> Here are the steps I use to install it (this has work successfully on
> 8 different MacBook laptops):
>
> 0) Install XCode (from the Snow Leopard Install DVD that came with the
> machines) and get all Software Updates for it to ensure it's on the
> latest version.
>
>
> 1) Install these applications (download from the appropriate locations):
>
> epd-6.1-1-macosx-i386.dmg
>
> cudatoolkit_3.0_macos_32.pkg
>
> cudadriver_3.0.14_macos.dmg
>
> gpucomputingsdk_3.0_macos_32.pkg
>
>
> 2) If the machine is running BASH, then you would open your ~/.profile
> file (creating it if it does not exist) and add the following lines
> (make sure to open a new terminal once you have done this):
>
> export PATH="/usr/local/cuda/bin:${PATH}"
>
> export 
> DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$HOME/pool/lib:${DYLD_LIBRARY_PATH}
>
> export PYTHONPATH=$HOME/lib/python:$PYTHONPATH
>
> But if it's running the old and out-dated and inferior TCSH you'll
> need to edit your .cshrc file to have this:
>
> set path=(/usr/local/cuda/bin $path)
>
> setenv DYLD_LIBRARY_PATH /usr/local/cuda/lib:$HOME/pool/lib
>
> setenv PYTHONPATH $HOME/lib/python
>
>
> 3) Create the lib/python directory:
>
> mkdir -p ~/lib/python
>
>
> 4) Install boost:
>
> # Download boost_1_42_0.tar.bz2
>
> # extract it
>
> tar xvjf boost_1_42_0.tar.bz2
>
> cd boost_1_42_0
>
> # install it (this is two lines)
>
> ./bootstrap.sh --prefix=$HOME/pool --libdir=$HOME/pool/lib
> --with-libraries=signals,thread,python
>
> ./bjam -j2 address-model=32_64 architecture=x86 variant=release
> link=shared install
>
> # fix the linking which seems to be broken
>
> cd ~/pool/lib
>
> install_name_tool -change
> /System/Library/Frameworks/Python.framework/Versions/2.6/Python
> /Library/Frameworks/Python.framework/Versions/Current/Python
> libboost_python.dylib
>
>
> 5) Install PyCuda:
>
> # Download pycuda-0.94rc.tar.gz
>
> # extract it
>
> tar xvzf pycuda-0.94rc.tar.gz
>
> cd pycuda-0.94rc
>
> # Run configure
> ./configure.py
>
> # Edit siteconf.py to point at your boost python and thread libraries
> in ~/pool/lib
>
> # install to ~/lib/python directory
>
> python setup.py install --home=~
>
> # make sure it works
>
> python test/test_driver.py
>
>
> I hope this helps!
> Per
>
>
> On Tue, Apr 20, 2010 at 9:46 AM, Ian Ozsvald <i...@ianozsvald.com> wrote:
>> I'm fairly certain that Python defaults to 64 bit on Snow Leopard (but
>> I run Leopard so can't confirm):
>> http://wiki.tiker.net/PyCuda/Installation/Mac#Notes_about_Snow_Leopard
>>
>> Someone else had a similar error in the past:
>> http://host304.hostmonster.com/pipermail/pycuda_tiker.net/2010-January/000884.html
>>
>> It might be worth downgrading to CUDA 2.3 - I think people in the past
>> have had pyCUDA working (you'll want to go back through the threads to
>> be sure). CUDA 3.0 is very new, maybe there are bugs that still need
>> fixing?
>>
>> See here for another user with 32/64bit Snow Leopard issues:
>> http://host304.hostmonster.com/pipermail/pycuda_tiker.net/2010-March/thread.html#1059
>>
>> Here a user gets pyCUDA 0.93 working on Snow Leopard - there's
>> something about changing the default build to 32bit (in 0.93) which
>> you might need to change when building on 64 bit (but that's a
>> guess!):
>> http://host304.hostmonster.com/pipermail/pycuda_tiker.net/2010-January/000916.html
>>
>> >From my own knowledge getting pyCUDA 0.94rc works fine on Leopard (32
>> bit) with CUDA 2.3.
>>
>> i.
>>
>> On 20 April 2010 13:38, Cyrus Omar <cy...@cmu.edu> wrote:
>>> So I've been spending the last several hours trying to install PyCUDA on
>>> Snow Leopard. Initially, seeing that CUDA 3.0 was 64-bit on OSX, I attempted
>>> to install everything 64-bit (boost, python, pycuda, etc.). I got as far as
>>> running test_driver.py which froze my machine completely, needing a hard
>>> reboot. No error message or anything (not the ones others have been
>>> reporting).
>>>
>>> Ok, take 2, try to install everything 32-bit. I got boost compiled as
>>> 32-bit, a fresh install of Sage 32-bit for Python. PyCUDA 0.93 after
>>> patching out setuptools for distutils makes and test_driver.py runs to
>>> success with the following strange warnings:
>>>
>>> /Users/cyrus/sage/local/lib/python2.6/site-packages/pycuda-0.93-py2.6-macosx-10.5-x86_64.egg/pycuda/compiler.py:11:
>>> UserWarning: call_capture_stdout is deprecated: use call_capture_output
>>> instead
>>>   return call_capture_stdout([nvcc, "--version"])
>>> /Users/cyrus/sage/local/lib/python2.6/site-packages/pycuda-0.93-py2.6-macosx-10.5-x86_64.egg/pycuda/compiler.py:192:
>>> UserWarning: Reading 'lmem' from cubin failed--SourceModule metadata may be
>>> unavailable.
>>>   warn("Reading '%s' from cubin failed--SourceModule metadata may be
>>> unavailable." % key)
>>> /Users/cyrus/sage/local/lib/python2.6/site-packages/pycuda-0.93-py2.6-macosx-10.5-x86_64.egg/pycuda/compiler.py:192:
>>> UserWarning: Reading 'smem' from cubin failed--SourceModule metadata may be
>>> unavailable.
>>>   warn("Reading '%s' from cubin failed--SourceModule metadata may be
>>> unavailable." % key)
>>> /Users/cyrus/sage/local/lib/python2.6/site-packages/pycuda-0.93-py2.6-macosx-10.5-x86_64.egg/pycuda/compiler.py:192:
>>> UserWarning: Reading 'reg' from cubin failed--SourceModule metadata may be
>>> unavailable.
>>>   warn("Reading '%s' from cubin failed--SourceModule metadata may be
>>> unavailable." % key)
>>>
>>> Which seems to mean mod.smem and all that return None instead of the proper
>>> values. The kernels still seem to work however, so this is vaguely
>>> acceptable at the moment.
>>>
>>> Trying to install PyCUDA 0.94rc (from PyPI) also finishes make but many of
>>> the tests now fail with errors like this and nothing works:
>>>
>>> E       ImportError:
>>> dlopen(/Users/cyrus/sage/local/lib/python2.6/site-packages/pycuda-0.94rc-py2.6-macosx-10.5-x86_64.egg/pycuda/_pvt_struct.so,
>>> 2): no suitable image found.  Did find:
>>> E
>>> /Users/cyrus/sage/local/lib/python2.6/site-packages/pycuda-0.94rc-py2.6-macosx-10.5-x86_64.egg/pycuda/_pvt_struct.so:
>>> mach-o, but wrong architecture
>>>
>>> I have no idea why both 0.93 and 0.94 call the directory macosx-10.5-x86_64
>>> instead of 10.6-i386.
>>>
>>> The latest git version has strange issues during make install where it ends
>>> with an error about configure.py not having been run the first time I do it
>>> (even though it had been) and then running it again goes to completion. The
>>> test_driver.py errors are the same as 0.94rc.
>>>
>>> For reference, PyOpenCL works fine in 64-bit mode on this machine.
>>>
>>> Any ideas?
>>>
>>> Cyrus
>>>
>>> _______________________________________________
>>> PyCUDA mailing list
>>> pyc...@host304.hostmonster.com
>>> http://host304.hostmonster.com/mailman/listinfo/pycuda_tiker.net
>>>
>>>
>>
>>
>>
>> --
>> Ian Ozsvald (A.I. researcher, screencaster)
>> i...@ianozsvald.com
>>
>> http://IanOzsvald.com
>> http://morconsulting.com/
>> http://TheScreencastingHandbook.com
>> http://ProCasts.co.uk/examples.html
>> http://twitter.com/ianozsvald
>>
>> _______________________________________________
>> PyCUDA mailing list
>> pyc...@host304.hostmonster.com
>> http://host304.hostmonster.com/mailman/listinfo/pycuda_tiker.net
>>
>



-- 
Ian Ozsvald (A.I. researcher, screencaster)
i...@ianozsvald.com

http://IanOzsvald.com
http://morconsulting.com/
http://TheScreencastingHandbook.com
http://ProCasts.co.uk/examples.html
http://twitter.com/ianozsvald

_______________________________________________
PyCUDA mailing list
pyc...@host304.hostmonster.com
http://host304.hostmonster.com/mailman/listinfo/pycuda_tiker.net

Reply via email to