Copy pinned-memory to cuda array crash

Hi all,

is there a limitation regarding the copy of host pinned-memory to a cuda Array? I tried to alloc the pinned memory with both cudaMallocHost and cudaHostAllocPortable, and both are crashing when running the copy.

I found this post The Official NVIDIA Forums | NVIDIA but I have not this problem of allocating the memory in a thread that would be terminated when running the copy by another thread.

Any idea?

Thanks

– pium

cudaHostAlloc( (void**)&m_buffer, getByteSize(), cudaHostAllocPortable );

// using 'new' operator works just fine
cudaMemcpy3DParms copyParams = {0};

    copyParams.srcPtr   = make_cudaPitchedPtr((void*)mypreviousbuffer, volumeSize.width*sizeof(char4), volumeSize.width, volumeSize.height);

    copyParams.dstArray = myArray;

    copyParams.extent   = volumeSize;

    copyParams.kind     = cudaMemcpyHostToDevice;

    cutilSafeCall( cudaMemcpy3D(&copyParams) ); // it crashes here

It is nothing to do with the cuda array, my problem is that cudaGLSetGLDevice( cutGetMaxGflopsDeviceId() ) is done after the cudaMallocHost.
It is quite hard to manage the gldevice in a complex application.