Workaround bug in CUDA runtime. When using CUDA 2.0, it's required to use a driver that supports CUDA 2.0.
This commit is contained in:
parent
36ed6bebda
commit
d01a5c1661
@ -68,6 +68,26 @@ static bool isWow32()
|
||||
|
||||
#endif
|
||||
|
||||
#if NV_OS_WIN32
|
||||
|
||||
static bool isCuda20DriverAvailable()
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
HINSTANCE nvcuda = LoadLibraryExA( "nvcuda.dll", NULL, 0 );
|
||||
if (nvcuda != NULL)
|
||||
{
|
||||
FARPROC lcuStreamCreate = GetProcAddress( nvcuda, "cuStreamCreate" );
|
||||
|
||||
result = lcuStreamCreate != NULL;
|
||||
|
||||
FreeLibrary( nvcuda );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// Determine if CUDA is available.
|
||||
bool nv::cuda::isHardwarePresent()
|
||||
@ -90,6 +110,14 @@ bool nv::cuda::isHardwarePresent()
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure that CUDA driver matches CUDA runtime.
|
||||
#if NV_OS_WIN32 && CUDART_VERSION >= 2000
|
||||
if (!isCuda20DriverAvailable())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// @@ Make sure that warp size == 32
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user