Problem with cudaMemcpy3d


I’d like to file an issue with cudaMemcpy3d function.

It seams to be ignoring cudaPos (src/dst) if pointed memory is on CPU side.

For example:


	cudaMemcpy3DParms parCpy3D = {0};

	parCpy3D.dstPtr = make_cudaPitchedPtr(ptr, lineSize, dim.x * sizeof(T), dim.y);

	parCpy3D.srcPtr = make_cudaPitchedPtr(d.ptr, d.lineSize, d.dim.x * sizeof(T), d.dim.y);

	parCpy3D.dstPos = make_cudaPos(startROI.x * sizeof(T), startROI.y, startROI.z);

	parCpy3D.srcPos = make_cudaPos(d.startROI.x * sizeof(T), d.startROI.y, d.startROI.z);

	parCpy3D.kind = direction;

	parCpy3D.extent = make_cudaExtent(d.sizeROI.x * sizeof(T), d.sizeROI.y, d.sizeROI.z);

	cudaSafeCall( cudaMemcpy3D( &parCpy3D), "Data - memory copy error");


the code won’t work properly if direction is one of: cudaMemcpyHostToHost, cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost.

There’s no error returned, but data is copied to/from the beginning of the pointed memory.

My system:

cuda 3.2, 266.58 driver, GF 420m, Win7 x64.

The way around is to move a pointer to the actual start location, but I don’t see a reason why it shouldn’t be done by the function.



Indeed, this was a bug in CUDA 3.2 (and all earlier versions). The bug is fixed in CUDA 4.0 RC – please give that a try.

Hi Christopher,
I’m glad it was resolved, but until 4.0 is officially released the problem stays as a bug.
I don’t have an access to 4.0RC and, honestly, I don’t know how many of new surprises wait for me there.
Never the less, thank you for your quick response.