Merge fixes from trunk. Prevent CUDA dll mismatches.
This commit is contained in:
parent
b013aa64b9
commit
cd112e2133
@ -22,6 +22,7 @@
|
|||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <nvcore/Debug.h>
|
#include <nvcore/Debug.h>
|
||||||
|
#include <nvcore/Library.h>
|
||||||
#include "CudaUtils.h"
|
#include "CudaUtils.h"
|
||||||
|
|
||||||
#if defined HAVE_CUDA
|
#if defined HAVE_CUDA
|
||||||
@ -69,6 +70,35 @@ static bool isWow32()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static bool isCudaDriverAvailable(uint version)
|
||||||
|
{
|
||||||
|
#if NV_OS_WIN32
|
||||||
|
Library nvcuda("nvcuda.dll");
|
||||||
|
#else
|
||||||
|
Library nvcuda(NV_LIBRARY_NAME("cuda"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!nvcuda.isValid())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version > 2000)
|
||||||
|
{
|
||||||
|
void * address = nvcuda.bindSymbol("cuStreamCreate");
|
||||||
|
if (address == NULL) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version > 2010)
|
||||||
|
{
|
||||||
|
void * address = nvcuda.bindSymbol("cuLoadDataEx");
|
||||||
|
if (address == NULL) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Determine if CUDA is available.
|
/// Determine if CUDA is available.
|
||||||
bool nv::cuda::isHardwarePresent()
|
bool nv::cuda::isHardwarePresent()
|
||||||
{
|
{
|
||||||
@ -90,6 +120,12 @@ bool nv::cuda::isHardwarePresent()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure that CUDA driver matches CUDA runtime.
|
||||||
|
if (!isCudaDriverAvailable(CUDART_VERSION))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// @@ Make sure that warp size == 32
|
// @@ Make sure that warp size == 32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user