avcodec/nvenc: add logging for more error cases

This commit is contained in:
Timo Rothenpieler 2017-01-18 23:22:28 +01:00
parent 5403d90f32
commit 6b0a3ee6f8
1 changed files with 6 additions and 2 deletions

View 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) {