summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAgatha Hu <ahu@nvidia.com>2015-09-11 10:54:08 +0800
committerTimo Rothenpieler <timo@rothenpieler.org>2015-09-11 10:11:29 +0200
commit81071eea7d90103dbbdbd878fc19822f10441fd5 (patch)
tree5c6b4edb19e85b8b7d0ac54ca873bbbc9a9aec81 /libavcodec
parentf58e011a1f30332ba824c155078ca701e29aef63 (diff)
avcodec/nvenc: change flag of cuCtxCreate to avoid CPU spins
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/nvenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 54906526eb..3174b01c2a 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -580,7 +580,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
}
ctx->cu_context = NULL;
- cu_res = dl_fn->cu_ctx_create(&ctx->cu_context, 0, dl_fn->nvenc_devices[ctx->gpu]);
+ cu_res = dl_fn->cu_ctx_create(&ctx->cu_context, 4, dl_fn->nvenc_devices[ctx->gpu]); // CU_CTX_SCHED_BLOCKING_SYNC=4, avoid CPU spins
if (cu_res != CUDA_SUCCESS) {
av_log(avctx, AV_LOG_FATAL, "Failed creating CUDA context for NVENC: 0x%x\n", (int)cu_res);