Do not use CUDA on emulation devices.
This commit is contained in:
parent
670310e558
commit
5946514408
@ -74,11 +74,24 @@ bool nv::cuda::isHardwarePresent()
|
|||||||
{
|
{
|
||||||
#if defined HAVE_CUDA
|
#if defined HAVE_CUDA
|
||||||
#if NV_OS_WIN32
|
#if NV_OS_WIN32
|
||||||
return !isWindowsVista() && deviceCount() > 0;
|
if (isWindowsVista()) return false;
|
||||||
//return !isWindowsVista() && isWow32() && deviceCount() > 0;
|
//if (isWindowsVista() || !isWow32()) return false;
|
||||||
#else
|
|
||||||
return deviceCount() > 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
int count = deviceCount();
|
||||||
|
if (count == 1)
|
||||||
|
{
|
||||||
|
// Make sure it's not an emulation device.
|
||||||
|
cudaDeviceProp deviceProp;
|
||||||
|
cudaGetDeviceProperties(&deviceProp, 0);
|
||||||
|
|
||||||
|
// deviceProp.name != Device Emulation (CPU)
|
||||||
|
if (deviceProp.major == -1 || deviceProp.minor == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count > 0;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user