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