Zhe Weng <[email protected]> writes: > Hi all, > > I'm doing some experiments on paged-locked memory, but got some errors that I > failed to address when I use aligned memory to invoke the kernel function. > > My code is like below: > > 1 import pycuda.driver as drv > 2 import autoinit > 3 > 4 temp = drv.aligned_empty(my_numpy_array.shape, dtype=my_numpy_array.dtype, > order='C') > 5 temp = drv.register_host_memory( temp, > flags=drv.mem_host_register_flags.DEVICEMAP) > 6 my_plptr = numpy.intp(temp.base.get_device_pointer()) > 7 > 8 start_event.record() > 9 kernel_function( my_plptr, rest_parameters, block, grid) > 10 end_event.record() > 11 end_event.synchronize() > > But when executing, it reports error saying > Traceback (most recent call last): > end.synchronize() > > pycuda._driver.LaunchError: cuEventSynchronize failed: launch failed > PyCUDA WARNING: a clean-up operation failed (dead context maybe?) > cuMemFree failed: launch failed > > > This code https://gist.github.com/4036292 works good on the same machine.
AFAIR, you need to create the context with device mapping enabled: http://documen.tician.de/pycuda/driver.html#pycuda.driver.ctx_flags.MAP_HOST Andreas _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
