cudaD3D9RegisterResource causes exception

Hello all.
if I try to step over the following call:

cudaError_t cudaerr;
cudaerr=cudaD3D9RegisterResource(pVB, cudaD3D9RegisterFlagsNone);

I get the following error:
cudaErrorPriorLaunchFailure
Can someone give point me to some additional information on this?

A search of the forums didn’t turn up much.
Thanks

The pVB is set up as follows.
LPDIRECT3DVERTEXBUFFER9 pVB = NULL;
if(FAILED(pDevice->CreateVertexBuffer( nBufferSize, 0, 0, D3DPOOL_DEFAULT, &pVB, NULL )))
return E_FAIL;