Hi,
I get:
Traceback (most recent call last):
File "sim_drift_gpu.py", line 4, in <module>
import pycuda.gpuarray as gpuarray
File "/usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-i686.egg/pycuda/gpuarray.py",
line 3, in <module>
import pycuda.elementwise as elementwise
File "/usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-i686.egg/pycuda/elementwise.py",
line 33, in <module>
from pycuda.tools import context_dependent_memoize
File "/usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-i686.egg/pycuda/tools.py",
line 30, in <module>
import pycuda.driver as cuda
File "/usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-i686.egg/pycuda/driver.py",
line 545, in <module>
_add_functionality()
File "/usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-i686.egg/pycuda/driver.py",
line 525, in _add_functionality
Function._param_set = function_param_set_pre_v4
NameError: global name 'function_param_set_pre_v4' is not defined
I think there is a typo in line 145 in driver.py when CUDA < 4.0 is used:
function_param_set -> function_param_set_pre_v4
so that it matches line 524:
Function._param_set = function_param_set_pre_v4
Thomas
On Sat, 28 Jan 2012 18:21:29 -0500, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
> I am currently revisiting this but having some problems with the
> random number generator.
>
> generator.generators_per_block is 512 on my card, so I initialize 512
> generators, but I see that some of them don't produce random numbers
> when sampling from them. I notice that in some subtle ways (mainly
> that the distribution is not correct or all numbers are the same) if I
> sample from more than 300-350 generators (always the last ones are
> affected), but it's fine when using e.g. 128. So it seems I can only
> use a smaller number of generators than what the card says I should be
> able to use.
>
> Any idea on why that might be or how to investigate this further?
Mysterious. What generator is this using? XORWOW? Tomasz, any ideas?
Andreas
On Tue, 22 May 2012 15:43:12 -0700, Bryan Catanzaro <bcatanzaro(a)acm.org> wrote:
> Sure, here's an example of how to call thrust::sort on a PyCUDA gpuarray.
> https://gist.github.com/2772091
Cool, like it! I've stolen this and put it here:
http://wiki.tiker.net/PyCuda/Examples/ThrustInterop
Bryan, can you please fill in a license there?
Thanks!
Andreas
On Tue, 22 May 2012 18:21:56 -0400, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
> On Tue, May 22, 2012 at 4:40 PM, Andreas Kloeckner
> <lists(a)informa.tiker.net> wrote:
> > On Tue, 22 May 2012 15:56:33 -0400, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
> >> Just to make sure: libcuda.so is provided along with the nvidia driver
> >> while the other .so files (e.g. cudart, curand) are provided by
> >> cudatoolkit, correct?
> >
> > Yup.
> >
> > Andreas
>
> Sorry, I'm genuinely confused :)
>
> What does the cuda.h correspond to that is packaged with cudatoolkit
> (since cudatoolkit does not contain a libcuda.so)?
>
> The nvidia driver (and also the linux kernel for that matter) all seem
> to provide a cuda.h. Is the cudatoolkit cuda.h the incorrect one to
> use for pycuda?
The kernel's cuda.h is something entirely different.
The driver did at one point install cuda.h, but it does not do so any
more AFAIK. It does install libcuda.so. Using an older cuda.h with a
newer libcuda.so is fine. Using a newer cuda.h with an older libcuda.so
will not work.
> What is the conceptual difference between libcuda.so and libcudart.so?
cudart is the run-time interface, which is used by 'conventional' CUDA C
code. (cudaMemcpy) PyCUDA uses the driver interface. (cuMemcpy)
> Using libcuda.so of the nvidia driver I get the above error (undefined
> symbol: cuTexRefSetAddress2D_v3).
>
> _driver.so is linked against the following:
>
> >>ldd /usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-x86_64.egg/pycuda/_driver.so
> linux-vdso.so.1 => (0x00007fffa1160000)
> libcuda.so.1 => /usr/lib/nvidia-current/libcuda.so.1
> (0x00007f322f248000)
> libcurand.so.4 => /usr/local/cuda/lib64/libcurand.so.4
> (0x00007f322d084000)
> libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> (0x00007f322cd7c000)
> libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
> (0x00007f322cb66000)
> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007f322c949000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f322c5a7000)
> libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f322c38f000)
> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f322c18b000)
> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f322bf06000)
> libcudart.so.4 => /usr/local/cuda/lib64/libcudart.so.4
> (0x00007f322bcad000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f322ff95000)
> librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f322baa4000)
In general, simply install matching versions of the driver and the
toolkit. In particular, use the driver from the CUDA download page, not
the 'regular' non-compute driver.
HTH,
Andreas
Sure, here's an example of how to call thrust::sort on a PyCUDA gpuarray.
https://gist.github.com/2772091
- bryan
On Tue, May 22, 2012 at 2:36 PM, Apostolis Glenis <apostglen46(a)gmail.com> wrote:
> That's great,do you have any ,preferably small,example to see exactly how it
> works?
>
> Thanks
>
> Apostolis
>
> 2012/5/23 Bryan Catanzaro <bcatanzaro(a)acm.org>
>>
>> I do it all the time using another of Andreas' projects: CodePy.
>>
>> - bryan
>>
>> On Tue, May 22, 2012 at 12:58 PM, Apostolis Glenis
>> <apostglen46(a)gmail.com> wrote:
>> > Just curious :
>> > What would it take to compile a thrust function with pyCUDA?
>> >
>> > Apostolis
>> >
>> > _______________________________________________
>> > PyCUDA mailing list
>> > PyCUDA(a)tiker.net
>> > http://lists.tiker.net/listinfo/pycuda
>> >
>
>
On Tue, 22 May 2012 15:56:33 -0400, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
> Just to make sure: libcuda.so is provided along with the nvidia driver
> while the other .so files (e.g. cudart, curand) are provided by
> cudatoolkit, correct?
Yup.
Andreas
I do it all the time using another of Andreas' projects: CodePy.
- bryan
On Tue, May 22, 2012 at 12:58 PM, Apostolis Glenis
<apostglen46(a)gmail.com> wrote:
> Just curious :
> What would it take to compile a thrust function with pyCUDA?
>
> Apostolis
>
> _______________________________________________
> PyCUDA mailing list
> PyCUDA(a)tiker.net
> http://lists.tiker.net/listinfo/pycuda
>
Just to make sure: libcuda.so is provided along with the nvidia driver
while the other .so files (e.g. cudart, curand) are provided by
cudatoolkit, correct?
On Tue, May 22, 2012 at 3:54 PM, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
> On Tue, May 22, 2012 at 2:04 PM, Andreas Kloeckner
> <lists(a)informa.tiker.net> wrote:
>> On Tue, 22 May 2012 13:55:36 -0400, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
>>> Hi,
>>>
>>> I updated various packages (e.g. ugpraded cuda to 4, most recent
>>> pycuda, ubuntu nvidia-dev drivers) on ubuntu 11.10. Pycuda was working
>>> fine before, but after rebuilding and reinstalling the newest version
>>> I get:
>>>
>>> ImportError: /usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-x86_64.egg/pycuda/_driver.so:
>>> undefined symbol: cuMemAllocPitch_v2
>>>
>>> When I import pycuda.gpuarray. Any ideas?
>>
>> Your CUDA headers don't match your installed libcuda.so. Check the
>> versions of both.
>
> Thanks, it was indeed caused by old cuda devel files floating around
> from a launchpad package I installed earlier. I think I cleaned all of
> that up and now only the cudatoolkit (4.1.28) is installed. However,
> now I get:
>
> ImportError: /usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-x86_64.egg/pycuda/_driver.so:
> undefined symbol: cuTexRefSetAddress2D_v3
>
> /usr/lib/libcuda.so (which _driver.so is linked to) seems to have this
> symbol so I'm not sure why it can't be found. Any ideas?
On Tue, 22 May 2012 13:55:36 -0400, Thomas Wiecki <Thomas_Wiecki(a)brown.edu> wrote:
> Hi,
>
> I updated various packages (e.g. ugpraded cuda to 4, most recent
> pycuda, ubuntu nvidia-dev drivers) on ubuntu 11.10. Pycuda was working
> fine before, but after rebuilding and reinstalling the newest version
> I get:
>
> ImportError: /usr/local/lib/python2.7/dist-packages/pycuda-2011.2.2-py2.7-linux-x86_64.egg/pycuda/_driver.so:
> undefined symbol: cuMemAllocPitch_v2
>
> When I import pycuda.gpuarray. Any ideas?
Your CUDA headers don't match your installed libcuda.so. Check the
versions of both.
HTH,
Andreas