Hi,
first of all: nice piece of work Andreas!
Now to my problem: I installed CUDA 2.1 on my T61 laptop computer with a
Nvidia Quadro NVS 140M graphics card w/ 128MB memory.
git version of PyCUDA (0.93 beta I assume) installs fine but I get some
errors when I try to run tests. First test_driver:
/opt/PyCUDA/pycuda-git/test$python test_driver.py
...E....Eterminate called after throwing an instance of 'cuda::error'
what(): cuMemFree failed: invalid context
Aborted
Or runnung gpuarray speed test:
/opt/PyCUDA/pycuda-git/test$python undistributed/test_gpuarray_speed.py
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
Traceback (most recent call last):
File "undistributed/test_gpuarray_speed.py", line 83, in <module>
main()
File "undistributed/test_gpuarray_speed.py", line 27, in main
b = gpuarray.zeros((size,), dtype=numpy.float32)
File
"/usr/lib/python2.5/site-packages/pycuda-0.93beta-py2.5-linux-x86_64.egg/pycuda/gpuarray.py",
line 409, in zeros
result = GPUArray(shape, dtype, stream, allocator)
File
"/usr/lib/python2.5/site-packages/pycuda-0.93beta-py2.5-linux-x86_64.egg/pycuda/gpuarray.py",
line 75, in __init__
self.gpudata = self.allocator(self.size * self.dtype.itemsize)
pycuda._driver.MemoryError: cuMemAlloc failed: out of memory
-----------------------------------------------------------
PyCUDA WARNING: I'm being asked to destroy a
context that's part of the current context stack.
-----------------------------------------------------------
I will pick the next lower active context from the
context stack. Since this choice is happening
at an unspecified point in time, your code
may be making false assumptions about which
context is active at what point.
Call Context.pop() to avoid this warning.
-----------------------------------------------------------
If Python is terminating abnormally (eg. exiting upon an
unhandled exception), you may ignore this.
-----------------------------------------------------------
test_gpuarray only threw some warnings:
python test_gpuarray.py
/usr/lib/python2.5/site-packages/pycuda-0.93beta-py2.5-linux-x86_64.egg/pycuda/gpuarray.py:498:
UserWarning: behavior change: arange guessed dtype other than float32.
suggest specifying explicit dtype.
warn("behavior change: arange guessed dtype other than float32. "
..................
----------------------------------------------------------------------
Ran 18 tests in 14.756s
OK
Here are some debug information you might need:
In [61]: pycuda.autoinit.device.get_attributes()
Out[62]:
{pycuda._driver.device_attribute.MAX_THREADS_PER_BLOCK: 512,
pycuda._driver.device_attribute.MAX_BLOCK_DIM_X: 512,
pycuda._driver.device_attribute.MAX_BLOCK_DIM_Y: 512,
pycuda._driver.device_attribute.MAX_BLOCK_DIM_Z: 64,
pycuda._driver.device_attribute.MAX_GRID_DIM_X: 65535,
pycuda._driver.device_attribute.MAX_GRID_DIM_Y: 65535,
pycuda._driver.device_attribute.MAX_GRID_DIM_Z: 1,
pycuda._driver.device_attribute.MAX_SHARED_MEMORY_PER_BLOCK: 16384,
pycuda._driver.device_attribute.TOTAL_CONSTANT_MEMORY: 65536,
pycuda._driver.device_attribute.WARP_SIZE: 32,
pycuda._driver.device_attribute.MAX_PITCH: 262144,
pycuda._driver.device_attribute.MAX_REGISTERS_PER_BLOCK: 8192,
pycuda._driver.device_attribute.CLOCK_RATE: 800000,
pycuda._driver.device_attribute.TEXTURE_ALIGNMENT: 256,
pycuda._driver.device_attribute.GPU_OVERLAP: 1,
pycuda._driver.device_attribute.MULTIPROCESSOR_COUNT: 2}
In [63]: pycuda.autoinit.device.compute_capability()
Out[63]: (1, 1)
In [65]: pycuda.autoinit.device.total_memory()
Out[65]: 133496832
In [66]: pycuda.autoinit.device.make_context()
terminate called after throwing an instance of 'cuda::error'
what(): cuMemFree failed: invalid context
Aborted
All the other tests were fine, so PyCUDA works nicely.
Could you please check where the "invalid context" error comes from?
And maybe add a memory checker to your tests so we low-mem GPU user are
not discriminated ;-).
Keep up the good work!
Philipp
Hi all,
I am trying to port the binomial options example from the CUDA SDK to pyCuda
as a learning exercise primarily, and I seem to be getting incorrect
results and am having trouble tracking down the problem. I am new to CUDA
and pyCuda.
Source code is here (no external dependencies other than pycuda - I'm
running Python 2.6 here on Ubuntu 9.04, and CUDA and pyCuda pass all
included tests as working fine):
http://www.alaricuscapital.com/pycuda-binomial.txt
I know that the basic logic in the kernel is correct, since it is copied
from the binomialOptions example in the SDK. However, I had to make a few
minor tweaks to it - namely, instead of using static arrays, I am passing in
the options input data as array arguments to the kernel, and I copied in
some #defines from the header to make it compile smoothly.
I have verified that this data I'm trying to pass is being received properly
in the kernel, by changing the kernel's return values to match each of the
input variables - so I am at least getting data to the function!
And I verified my comparison function "binomialOptionFromProcessed" against
a known-good implementation of European Call binomial option pricing from
the pyFinancials library - they produce identical results for the same
number of steps, so I know I didn't munge that up.
However, they are clearly not producing consistent results.
So the two possibilities seem to be that I'm doing something wrong in the
pyCuda portion of my code that is mucking up my data down at the bottom of
the binomialOptionsGPU function, or that in tweaking the kernel from the SDK
I have broken something in the kernel (either because I replaced the static
arrays, or something else).
I was hoping for some guidance on this, at least to help me rule out stupid
mistakes with how I am invoking pyCUDA so I can better focus my debugging
efforts.
Thanks in advance for any help!
Raefer Gabriel
oops. forwarding to list.
---------- Forwarded message ----------
From: Brent Pedersen <bpederse(a)gmail.com>
Date: Wed, Apr 29, 2009 at 1:36 PM
Subject: Re: [PyCuda] pycuda on ubuntu 9.04?
To: Andreas Klöckner <lists(a)informa.tiker.net>
On Wed, Apr 29, 2009 at 12:01 PM, Andreas Klöckner
<lists(a)informa.tiker.net> wrote:
> On Mittwoch 29 April 2009, Brent Pedersen wrote:
>> hi, i've never tried cuda or pycuda before, but i'm trying now on a
>> clean system with ubuntu 9.04.
>> i downloaded the install script for linux-64 ubuntu 8.04 here:
>> http://www.nvidia.com/object/cuda_get.html
>>
>> will that work for 9.04? must one wait for the 9.04 version to appear?
>> or are sources available?
>>
>> for now, i get cuda and pycuda to install but when i try it out, i see
>> the output below.
>> any ideas on what i can try?
>> thanks,
>> -brent
>>
>> $ python -c "import pycuda.autoinit"
>> Traceback (most recent call last):
>> File "<string>", line 1, in <module>
>> File
>> "/usr/lib/python2.5/site-packages/pycuda-0.92-py2.5-linux-x86_64.egg/pycuda
>>/autoinit.py", line 5, in <module>
>> cuda.init()
>> Boost.Python.ArgumentError: Python argument types in
>> pycuda._driver.init()
>> did not match C++ signature:
>> init(unsigned int flags=0)
>
> Something seems fishy here: That snippet says "python2.5" in various places,
> but I seem to recall that the default Python version in 9.04 should be 2.6.
> Can you shed some light here?
yes, i still am using 2.5 so i did cp /usr/bin/python{2.5,}
is that likely to cause problems?
>
> This looks like an issue with Boost.Python--the flags argument default
> assignment isn't recognized somehow.
>
> Also, can you send the output of
>
> ldd /usr/lib/python2.5/site-packages/pycuda-0.92-py2.5-linux-
> x86_64.egg/pycuda/_internal.so
>
i dont have _internal.so maybe that's the prob, i have this:
$ ldd /usr/lib/python2.5/site-packages/pycuda-0.92-py2.5-linux-x86_64.egg/pycuda/_driver.so
linux-vdso.so.1 => (0x00007fffdc3fe000)
libboost_python-gcc42-mt-1_34_1-py26.so.1.34.1 =>
/usr/lib/libboost_python-gcc42-mt-1_34_1-py26.so.1.34.1
(0x00007ff8d3e4e000)
libcuda.so.1 => /usr/lib/libcuda.so.1 (0x00007ff8d39ad000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ff8d369f000)
libm.so.6 => /lib/libm.so.6 (0x00007ff8d341a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007ff8d3202000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007ff8d2fe5000)
libc.so.6 => /lib/libc.so.6 (0x00007ff8d2c73000)
libutil.so.1 => /lib/libutil.so.1 (0x00007ff8d2a70000)
libdl.so.2 => /lib/libdl.so.2 (0x00007ff8d286b000)
librt.so.1 => /lib/librt.so.1 (0x00007ff8d2663000)
libz.so.1 => /lib/libz.so.1 (0x00007ff8d244b000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff8d4367000)
> What version of boost are you using?
looks like 1.34.1-15 which is the default in the ubuntu 9.04 repos.
thanks.
-brent
>
> Andreas
>
> _______________________________________________
> PyCuda mailing list
> PyCuda(a)tiker.net
> http://tiker.net/mailman/listinfo/pycuda_tiker.net
>
>
hi, i've never tried cuda or pycuda before, but i'm trying now on a
clean system with ubuntu 9.04.
i downloaded the install script for linux-64 ubuntu 8.04 here:
http://www.nvidia.com/object/cuda_get.html
will that work for 9.04? must one wait for the 9.04 version to appear?
or are sources available?
for now, i get cuda and pycuda to install but when i try it out, i see
the output below.
any ideas on what i can try?
thanks,
-brent
$ python -c "import pycuda.autoinit"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/pycuda-0.92-py2.5-linux-x86_64.egg/pycuda/autoinit.py",
line 5, in <module>
cuda.init()
Boost.Python.ArgumentError: Python argument types in
pycuda._driver.init()
did not match C++ signature:
init(unsigned int flags=0)
=============================
Yes, I'm also having no trouble with 2.6 (installed by opensuse).
To reply to digest messages, go to the web archive, select a message, and
click on the sender name. It will give you a URL that sets the subject line
and reply-to fields correctly.
regards,
Nicholas
I *suspect* so. I built a number of libraries (numpy, scipy, matplotlib)
from source just before upgrading to jaunty, and have had a number of
glitches on my laptop. When I distro-up my home desktop I will exercise
Pycuda.
I suspect also that it could be linked to modules installed using
easy_install because my laptop can't find the libraries installed in that
fashion when running 2.6.
-Matt
On Mon, Apr 27, 2009 at 11:00 AM, <pycuda-request(a)tiker.net> wrote:
> Send PyCuda mailing list submissions to
> pycuda(a)tiker.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://tiker.net/mailman/listinfo/pycuda_tiker.net
> or, via email, send a message with subject or body 'help' to
> pycuda-request(a)tiker.net
>
> You can reach the person managing the list at
> pycuda-owner(a)tiker.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyCuda digest..."
>
>
> Today's Topics:
>
> 1. Re: PyCuda Digest, Vol 10, Issue 14 (Matt G)
> 2. Re: PyCuda Digest, Vol 10, Issue 14 (Andreas Kl?ckner)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 26 Apr 2009 21:30:55 -0700
> From: Matt G <meawoppl(a)gmail.com>
> Subject: Re: [PyCuda] PyCuda Digest, Vol 10, Issue 14
> To: pycuda(a)tiker.net
> Message-ID:
> <f24d089c0904262130v7d40b067g826acc96f4e6f823(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Quick fix is using python2.5. It looks like python2.6 is the default that
> "python" is hooked to under Jaunty. They made some changes to subprocess I
> don't have time dig into, but it is causing problems with some of my code
> as
> well. Also notably, if you used "easy_install" python2.6 probably wont
> find
> most of the libraries you installed in that fashion.
>
> -Matt
>
> On Sat, Apr 25, 2009 at 11:00 AM, <pycuda-request(a)tiker.net> wrote:
>
> > Send PyCuda mailing list submissions to
> > pycuda(a)tiker.net
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > http://tiker.net/mailman/listinfo/pycuda_tiker.net
> > or, via email, send a message with subject or body 'help' to
> > pycuda-request(a)tiker.net
> >
> > You can reach the person managing the list at
> > pycuda-owner(a)tiker.net
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of PyCuda digest..."
> >
> >
> > Today's Topics:
> >
> > 1. Bad file descriptor error with PyCuda 0.92 (Minjae Kim)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Sat, 25 Apr 2009 12:55:11 -0400
> > From: Minjae Kim <the.minjae+pc(a)gmail.com <the.minjae%2Bpc(a)gmail.com> <
> the.minjae%2Bpc(a)gmail.com <the.minjae%252Bpc(a)gmail.com>>>
> > Subject: [PyCuda] Bad file descriptor error with PyCuda 0.92
> > To: pycuda(a)tiker.net
> > Message-ID:
> > <a609314a0904250955x6d299848wba33a9e860a9c7d7(a)mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Hello,
> >
> > I reinstalled my OS to Ubuntu 9.04, and it seems that I can't even run
> the
> > basic Pycuda tutorial.
> > PyCuda 0.92 is refusing to work with Python 2.6. I am getting "bad file
> > descriptor error" in subprocess.py of Python. I have several questions:
> > 0. Is there a quick fix?
> > 1. I read online that PyCuda 0.93 works fine with Python 2.6 Can this
> be
> > confirmed?
> > 2. Somehow, I can't quite get 0.93 snapshot from
> > http://git.tiker.net/?p=pycuda.git;a=summary
> > I just get empty files when I click snapshot.
> >
> > Thanks.
> > Minjae
> >
Quick fix is using python2.5. It looks like python2.6 is the default that
"python" is hooked to under Jaunty. They made some changes to subprocess I
don't have time dig into, but it is causing problems with some of my code as
well. Also notably, if you used "easy_install" python2.6 probably wont find
most of the libraries you installed in that fashion.
-Matt
On Sat, Apr 25, 2009 at 11:00 AM, <pycuda-request(a)tiker.net> wrote:
> Send PyCuda mailing list submissions to
> pycuda(a)tiker.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://tiker.net/mailman/listinfo/pycuda_tiker.net
> or, via email, send a message with subject or body 'help' to
> pycuda-request(a)tiker.net
>
> You can reach the person managing the list at
> pycuda-owner(a)tiker.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyCuda digest..."
>
>
> Today's Topics:
>
> 1. Bad file descriptor error with PyCuda 0.92 (Minjae Kim)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 25 Apr 2009 12:55:11 -0400
> From: Minjae Kim <the.minjae+pc(a)gmail.com <the.minjae%2Bpc(a)gmail.com>>
> Subject: [PyCuda] Bad file descriptor error with PyCuda 0.92
> To: pycuda(a)tiker.net
> Message-ID:
> <a609314a0904250955x6d299848wba33a9e860a9c7d7(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> I reinstalled my OS to Ubuntu 9.04, and it seems that I can't even run the
> basic Pycuda tutorial.
> PyCuda 0.92 is refusing to work with Python 2.6. I am getting "bad file
> descriptor error" in subprocess.py of Python. I have several questions:
> 0. Is there a quick fix?
> 1. I read online that PyCuda 0.93 works fine with Python 2.6 Can this be
> confirmed?
> 2. Somehow, I can't quite get 0.93 snapshot from
> http://git.tiker.net/?p=pycuda.git;a=summary
> I just get empty files when I click snapshot.
>
> Thanks.
> Minjae
>
Hello,
I reinstalled my OS to Ubuntu 9.04, and it seems that I can't even run the
basic Pycuda tutorial.
PyCuda 0.92 is refusing to work with Python 2.6. I am getting "bad file
descriptor error" in subprocess.py of Python. I have several questions:
0. Is there a quick fix?
1. I read online that PyCuda 0.93 works fine with Python 2.6 Can this be
confirmed?
2. Somehow, I can't quite get 0.93 snapshot from
http://git.tiker.net/?p=pycuda.git;a=summary
I just get empty files when I click snapshot.
Thanks.
Minjae
Hi,
> I reinstalled my OS to Ubuntu 9.04, and it seems that I can't even run the
> basic Pycuda tutorial. PyCuda 0.92 is refusing to work with Python 2.6. I
> am getting "bad file descriptor error" in subprocess.py of Python. I have
> several questions: 0. Is there a quick fix?
> 1. I read online that PyCuda 0.93 works fine with Python 2.6 Can this be
> confirmed?
> 2. Somehow, I can't quite get 0.93 snapshot from
> http://git.tiker.net/?p=pycuda.git;a=summary I just get empty files when I
> click snapshot.
No problem here with ubuntu 9.04 and python 2.6. Can you give more details?
I've used pycuda 0.92 and yesterday I upgraded to the pre-0.93 version (to
use threading) using git - both work.
Vincent
--
Vincent Favre-Nicolin
CEA/Grenoble Institut Nanosciences & Cryogénie -
http://inac.cea.fr/
Université Joseph Fourier - http://physique-eea.ujf-grenoble.fr/
tél: (+33) 4 38 78 95 40 fax: (+33) 4 38 78 51 38
Device emulation mode isn't that fast anyways; it forks a bunch of pthreads,
which is quite slow.
For relevant speed comparisons, you might look at mcuda. I'm not sure if
there's any source available though.
cython with the numpy buffer interface is a pretty fast way to implement
efficient host-side C algorithms.
regards,
Nicholas