On Tue, 1 May 2012 16:38:42 -0400, Frédéric Bastien <nouiz(a)nouiz.org> wrote:
> If I do not call pycuda.autoinit, I get this error:
>
> LogicError: explicit_context_dependent failed: invalid context - no
> currently active context?
>
>
> If I try to manually init the driver like show in the doc like this:
>
> import pycuda.driver as cuda
> cuda.init() #init pycuda driver
> current_dev = cuda.Device(device_nr) #device we are working on
> ctx = current_dev.make_context() #make a working context
> ctx.push() #let context make the lead
>
> I get this error:
>
> LogicError: cuCtxCreate failed: invalid device
>
>
> I'm triing to force to always initialize pycuda gpu first. I can do it
> , but it is not easy. So if someone remember how or can find where we
> explained how to tell pycuda to reuse the current open context, it
> would be great.
There's a new method Context.attach(), which attaches to (and returns) the
currently active context. This should do what you need, I think. Please
let me know whether this works--otherwise I'll revert this change.
Thanks,
Andreas
On Fri, 4 May 2012 21:12:07 +0900, Norio Saito <no5ri1o5(a)gmail.com> wrote:
> My name is Norio Saito and I think PyCUDA is one of amazing libraries in
> Python.
> So I would like to expand recognition of this library in Japan,
> and then I have translated PyCUDA documentation <
> http://documen.tician.de/pycuda/> into Japanese.
> I would like to open this translated site to the public.
> Please give me a permission for it.
By all means, go ahead. How did you do this technically? Did you start
From the Sphinx/ReST source or from the HTML? If you'll share the URL,
I'd be happy to point to it from the 'official' (English) docs.
Andreas
Hello Andreas,
My name is Norio Saito and I think PyCUDA is one of amazing libraries in
Python.
So I would like to expand recognition of this library in Japan,
and then I have translated PyCUDA documentation <
http://documen.tician.de/pycuda/> into Japanese.
I would like to open this translated site to the public.
Please give me a permission for it.
Sincerely,
--------------------
Norio Saito
On Fri, 27 Apr 2012 15:52:03 -0400, Lars Pastewka <pas(a)pha.jhu.edu> wrote:
> Hello Everybody,
>
> I ran into the following problem with PuCUDA. When I calling for example
>
> import pycuda.gpuarray as gpu
> a = np.array([ [ 0, 1, 2 ], [ 1, 2, 3 ] ], dtype=np.float64)
> a_gpu = gpu.to_gpu(np.transpose(a))
>
> a_gpu does not contain the transposed, but the original array.
>
> When looking into the numpy source I find that the transpose operation
> just flips the FORTRAN flag. This can be easily checked:
>
> >>> a.flags.fortran
> False
> >>> b=np.transpose(a)
> >>> b.flags.fortran
> True
> >>> c=np.transpose(b)
> >>> c.flags.fortran
> False
> >>>
>
> GPUArray.set just copies the raw data. So if the FORTRAN flag is set,
> the array on the GPU will end up transposed. Does anybody know an easy
> fix for this behavior?
You should now get a warning if you try this. I didn't quite dare make
this an error just yet, but it is now deprecated behavior and will go
away in 2013.x.
Andreas
Wonderful, thanks!
On Wed, May 2, 2012 at 11:47 AM, Andreas Kloeckner
<kloeckner(a)cims.nyu.edu> wrote:
> On Fri, 27 Apr 2012 15:52:03 -0400, Lars Pastewka <pas(a)pha.jhu.edu> wrote:
>> Hello Everybody,
>>
>> I ran into the following problem with PuCUDA. When I calling for example
>>
>> import pycuda.gpuarray as gpu
>> a = np.array([ [ 0, 1, 2 ], [ 1, 2, 3 ] ], dtype=np.float64)
>> a_gpu = gpu.to_gpu(np.transpose(a))
>>
>> a_gpu does not contain the transposed, but the original array.
>>
>> When looking into the numpy source I find that the transpose operation
>> just flips the FORTRAN flag. This can be easily checked:
>>
>> >>> a.flags.fortran
>> False
>> >>> b=np.transpose(a)
>> >>> b.flags.fortran
>> True
>> >>> c=np.transpose(b)
>> >>> c.flags.fortran
>> False
>> >>>
>>
>> GPUArray.set just copies the raw data. So if the FORTRAN flag is set,
>> the array on the GPU will end up transposed. Does anybody know an easy
>> fix for this behavior?
>
> That's a bug--.set() is missing checks for matching strides. I'll add
> that and let you know when it's done.
>
> Andreas
>
> --
> Andreas Kloeckner
> Room 1105A (Warren Weaver Hall), Courant Institute, NYU
> http://www.cims.nyu.edu/~kloeckner/
> +1-401-648-0599
On Tue, May 1, 2012 at 1:02 PM, Eli Stevens (Gmail)
<wickedgrey(a)gmail.com> wrote:
> I recall the pci bus ID behavior changing between... 4.0 and 4.1
> maybe? It swapped from being a property-like thing to being a
> callable, with only changing the underlying cuda version (no PyCUDA
> update).
>
> What version of cuda are you using?
4.2.9
But, your question prompted me to look more closely and it turns out I
had followed the link on the pycuda line to the 4.0 drivers, so when
went back to download the 4.2 drivers from NVIDIA's site and rebuilt
pycuda (and rebooted the box as some of the cuda tests on the nvidia
side didn't pass without a reboot), then all is well.
So put this one down to pilot error.
Thanks for the quick feedback that led me to discover my error!
--
Sergio (Serge) Rey
Professor, School of Geographical Sciences and Urban Planning
Arizona State University
http://geoplan.asu.edu/rey
Editor, International Regional Science Review
http://irx.sagepub.com
On Mon, 30 Apr 2012 16:58:59 -0400, Frédéric Bastien <nouiz(a)nouiz.org> wrote:
> Hi,
>
> I have a the driver already initialized and I want pycuda to reuse
> that context. How can I make this? I didn't found in the doc or in
> previous email. But I remember having it somewhere. Can someone find
> this information again?
Just start using CUDA, I think. Since context state is implicit, you'll
be good to go as soon as a context exists... ?
Andreas
I recall the pci bus ID behavior changing between... 4.0 and 4.1
maybe? It swapped from being a property-like thing to being a
callable, with only changing the underlying cuda version (no PyCUDA
update).
What version of cuda are you using?
Eli
On Tue, May 1, 2012 at 11:50 AM, Serge Rey <srey(a)asu.edu> wrote:
> Hi,
>
> Following the install instructions for PyCuda on Lion I'm able to
> build and install
> without any errors. However if I run the test I'm getting:
>
> Traceback (most recent call last):
> File "test_driver.py", line 4, in <module>
> from pycuda.tools import mark_cuda_test
> File "/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/tools.py",
> line 30, in <module>
> import pycuda.driver as cuda
> File "/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/driver.py",
> line 2, in <module>
> from pycuda._driver import *
> ImportError: dlopen(/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so,
> 2): Symbol not found: _cuDeviceGetByPCIBusId
> Referenced from:
> /Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so
> Expected in: flat namespace
> in /Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so
>
>
> I've got the CUDA tookit and drivers installed and paths dialed in
> accordingly, so I'm wondering if anyone has an idea of what might be going
> wrong?
>
> Thanks,
>
>
> --
> Sergio (Serge) Rey
> Professor, School of Geographical Sciences and Urban Planning
> GeoDa Center for Geospatial Analysis and Computation
> Arizona State University
> http://geoplan.asu.edu/rey
>
> Editor, International Regional Science Review
> http://irx.sagepub.com
>
> _______________________________________________
> PyCUDA mailing list
> PyCUDA(a)tiker.net
> http://lists.tiker.net/listinfo/pycuda
Hi,
Following the install instructions for PyCuda on Lion I'm able to
build and install without any errors. However if I run the test I'm getting:
Traceback (most recent call last):
File "test_driver.py", line 4, in <module>
from pycuda.tools import mark_cuda_test
File "/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/tools.py",
line 30, in <module>
import pycuda.driver as cuda
File "/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/driver.py",
line 2, in <module>
from pycuda._driver import *
ImportError: dlopen(/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so,
2): Symbol not found: _cuDeviceGetByPCIBusId
Referenced from:
/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so
I've got the CUDA tookit and drivers installed and paths dialed in
accordingly, so I'm wondering if anyone has an idea of what might be going
wrong?
Thanks
--
Sergio (Serge) Rey
Professor, School of Geographical Sciences and Urban Planning
Arizona State University
http://geoplan.asu.edu/rey
Editor, International Regional Science Review
http://irx.sagepub.com
Hi,
Following the install instructions for PyCuda on Lion I'm able to
build and install
without any errors. However if I run the test I'm getting:
Traceback (most recent call last):
File "test_driver.py", line 4, in <module>
from pycuda.tools import mark_cuda_test
File "/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/tools.py",
line 30, in <module>
import pycuda.driver as cuda
File "/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/driver.py",
line 2, in <module>
from pycuda._driver import *
ImportError: dlopen(/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so,
2): Symbol not found: _cuDeviceGetByPCIBusId
Referenced from:
/Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/pycuda-2011.2.2-py2.7-macosx-10.7-intel.egg/pycuda/_driver.so
I've got the CUDA tookit and drivers installed and paths dialed in
accordingly, so I'm wondering if anyone has an idea of what might be going
wrong?
Thanks,
--
Sergio (Serge) Rey
Professor, School of Geographical Sciences and Urban Planning
GeoDa Center for Geospatial Analysis and Computation
Arizona State University
http://geoplan.asu.edu/rey
Editor, International Regional Science Review
http://irx.sagepub.com