Bugfix: detection of GPU vram over 4GB

This commit is contained in:
intrigus
2017-02-28 12:55:12 +01:00
committed by Laurent Clouet
parent e883148c89
commit ddac792ab7
2 changed files with 8 additions and 2 deletions

View File

@@ -91,7 +91,13 @@ public class GPU {
}
LongByReference ram = new LongByReference();
result = cudalib.cuDeviceTotalMem(ram, num);
try {
result = cudalib.cuDeviceTotalMem_v2(ram, num);
}
catch (UnsatisfiedLinkError e) {
// fall back to old function
result = cudalib.cuDeviceTotalMem(ram, num);
}
if (result != CUresult.CUDA_SUCCESS) {
System.out.println("GPU::generate cuDeviceTotalMem failed (ret: " + CUresult.stringFor(result) + ")");