Unknown Error when using Direct3D 9 interop

Hi all.

I’m using the driver API to run a kernel on a D3D 9 texture and generate some statistics about it. On one PC I’ve been getting a CUDA_ERROR_UNKNOWN return code from cuCtxSynchronize() after the kernel call. The strange part is: when i started commenting out parts of my code I ended up with a minimal version that only contains the following:

[codebox]cuD3D9RegisterResource(pResource, CU_D3D9_REGISTER_FLAGS_NONE);

cuD3D9ResourceSetMapFlags(pResource, CU_D3D9_MAPRESOURCE_FLAGS_READONLY);

cuD3D9MapResources(1, &pResource.p);

// Commented out kernel call goes here.

er = cuCtxSynchronize();

if (er) {

    // er is CUDA_ERROR_UNKNOWN when mapResources is called and CUDA_SUCCESS when it isn't.

ASSERT(!"cuCtxSynchronize() failed!");

return 0x0;


cuD3D9UnmapResources(1, &pResource.p);

// Commented out device to host copy and unregister goes here.[/codebox]

When i also comment out cuD3D9MapResources and cuD3D9UnmapResources no CUDA_SUCCESS is returned by the synchronize function instead. This suggests to me that mapping the resource is somehow failing, but the return code from the map resources call is CUDA_SUCCESS.

So I’ve been wondering if anyone here has encountered something similar. The PC where this error occurs is running CUDA 2.3 on Vista 32 bit. The error also occured with CUDA 2.2. The GPU is a GTX 280.

Thanks in advance

What driver are you using?

I have this problem with three different driver versions:

185.85, 186.18 and 190.38

Could I get some kind of comment on this? Could it be a problem with my hardware or do you need any additional information?

Can anyone say anything about this problem?

Update: I still have this problem with driver version 190.89