From ce6a8da1883bbc3e8c62284b365c2bab3d7fc555 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sun, 18 Dec 2016 03:23:11 +0100 Subject: [PATCH] cuda: prevent ptxas crash with -n --- cuda.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cuda.cpp b/cuda.cpp index 5afaeec..921e578 100644 --- a/cuda.cpp +++ b/cuda.cpp @@ -122,7 +122,9 @@ void cuda_print_devices() void cuda_shutdown() { - cudaDeviceSynchronize(); + // require gpu init first + if (thr_info != NULL) + cudaDeviceSynchronize(); cudaDeviceReset(); }