OSDN Git Service

avcodec/nvenc: add logging for more error cases
authorTimo Rothenpieler <timo@rothenpieler.org>
Wed, 18 Jan 2017 22:22:28 +0000 (23:22 +0100)
committerTimo Rothenpieler <timo@rothenpieler.org>
Fri, 20 Jan 2017 09:29:36 +0000 (10:29 +0100)
libavcodec/nvenc.c

index 27d1a2b..7005465 100644 (file)
@@ -325,12 +325,16 @@ static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
     }
 
     cu_res = dl_fn->cuda_dl->cuDeviceGetName(name, sizeof(name), cu_device);
-    if (cu_res != CUDA_SUCCESS)
+    if (cu_res != CUDA_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "cuDeviceGetName failed on device %d\n", idx);
         return -1;
+    }
 
     cu_res = dl_fn->cuda_dl->cuDeviceComputeCapability(&major, &minor, cu_device);
-    if (cu_res != CUDA_SUCCESS)
+    if (cu_res != CUDA_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "cuDeviceComputeCapability failed on device %d\n", idx);
         return -1;
+    }
 
     av_log(avctx, loglevel, "[ GPU #%d - < %s > has Compute SM %d.%d ]\n", idx, name, major, minor);
     if (((major << 4) | minor) < NVENC_CAP) {