Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions devito/arch/archinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,14 @@ def check_cuda_runtime():
driver_version = ctypes.c_int()
runtime_version = ctypes.c_int()

if cuda.cudaDriverGetVersion(ctypes.byref(driver_version)) == 0 and \
cuda.cudaRuntimeGetVersion(ctypes.byref(runtime_version)) == 0:
driver_version = driver_version.value
runtime_version = runtime_version.value

driver_v = parse(str(driver_version/1000))
runtime_v = parse(str(runtime_version/1000))
# Check the get*Version call succeeds and is a non-zero value
call_success = cuda.cudaDriverGetVersion(ctypes.byref(driver_version)) == 0
call_success &= cuda.cudaRuntimeGetVersion(ctypes.byref(runtime_version)) == 0
call_success &= bool(driver_version.value)

if call_success:
driver_v = parse(str(driver_version.value/1000))
runtime_v = parse(str(runtime_version.value/1000))
# First check the "major" version, known to be incompatible
if driver_v.major < runtime_v.major:
raise RuntimeError(
Expand Down
Loading