cudaDeviceGetByPCIBusId crashes nvcuda.dll on Windows 10 systems

Hi,

The following code manage to crash on my Windows 10 systems with driver 355.82, after repeated process launches:

int main(int argc, const char* argv[])
{
        if (argc != 2)
	{
		cout << "Usage: CudaDeviceInfo <pci_location>" << endl;
		return -1;
	}

	int numDev = 0;
	int dev = 0;
	cudaError_t errCode = cudaDeviceGetByPCIBusId(&dev, argv[1]);
	if (errCode == cudaSuccess)
	{
		cudaDeviceProp prop;
		errCode = cudaGetDeviceProperties(&prop, dev);
		if (errCode == cudaSuccess)
		{
			cout << "CUDA device id " << dev << endl;
			cout << "prop.name " << prop.name << endl;
			cout << "prop.pciBusID " << prop.pciBusID << endl;
			cout << "prop.pciDeviceID " << prop.pciDeviceID << endl;
			cout << "prop.pciDomainID " << prop.pciDomainID << endl;
			cout << "prop.integrated " << prop.integrated << endl;
			cout << "prop.isMultiGpuBoard " << prop.isMultiGpuBoard << endl;
			float pitch = prop.memPitch / (1024 * 1024 * 1024.0);
			cout << "prop.memPitch " << pitch << "GB" << endl;
			float gmem = prop.totalGlobalMem / (1024 * 1024 * 1024.0);
			cout << "prop.totalGlobalMem " << gmem << "GB" << endl;
			cout << endl;
		}
	}
	errCode = cudaDeviceReset();
	cout << "cudaDeviceReset returns " << cudaGetErrorString(errCode) << endl;
	return 0;
}

When the process crashes, the execution path from VS2013 remote debugger tracing stops at the call to cudaDeviceGetByPCIBusId. The top of the stack dump showed nvcuda.dll. Crash dump file analysis using both VS2013 debugger and WinDbg reported an access violation from nvcuda.dll.

I cannot find crash references to cudaDeviceGetByPCIBusId from google search. Has anyone experienced this? Did I use cudaDeviceGetByPCIBusId wrongly? I have tried calling the function this way:

cudaError_t errCode = cudaDeviceGetByPCIBusId(&dev, "1:0.0");

and the program still crashes after about 15 consecutive launches.

Thanks

which CUDA version?

Toolkit 6.5. cudart64_65.dll as the redistributable. 64-bit debug build.

I am using the [bus]:[device].[function] string format as the input to cudaDeviceGetByPCIBusId when the crash happen. Example string is “1:0.0”.

CUDA 6.5 does not officially support win10
maybe try cuda 7.5

OK. I can try working around the problem by using the pci bus and device numbers from cudaDeviceProp. Thanks.