Today I upgraded CUDA from 2.0 to 2.1 release, as well as the driver from 178.24 to 181.20,
rebuild my exising app and run, but then I found the whole system went lagggging badly, look like a driver crash.
So I wrote a test to narrow it down, the crash occurred in the invoking of cudaD3D9UnmapResources() of a D3D9 render target texture, more specific, a D3DFMT_A8R8G8B8 render target texture, common textures (created with D3DUSAGE set to 0) and other format like D3DFMT_A16B16G16R16F will not trigger the issue.
Here is some snippet extracted from the test code, rather simple:
1 mDevice->CreateTexture(1920, 1080, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &mTexture, NULL); 2 cudaD3D9SetDirect3DDevice(mDevice); 3 cudaD3D9RegisterResource(mTexture, cudaD3D9RegisterFlagsNone); 4 cudaD3D9MapResources(1, (IDirect3DResource9**)&mTexture); 5 cudaD3D9UnmapResources(1, (IDirect3DResource9**)&mTexture);
when running to the 5th line, the issue will be reproduced, and this applies to the driver API working in a host multithreaded env too.
Is this a driver bug or I misused something??? Any help will be appreciated.
and here is my system configuration:
System: Intel Core2 E6300 1.8Ghz, 2GB RAM, WinXP with all latest service packs installed
GPUs: GTX280 x1
CUDA version: CUDA 2.1 release toolkit and SDK
Driver version: 181.2x (181.20 and 181.22 will both repro the issue)
Compiler: Visual studio 2005 with sp1