From patchwork Mon Feb 13 21:24:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Miroslav_Sluge=C5=88?= X-Patchwork-Id: 2543 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1118416vsb; Mon, 13 Feb 2017 13:24:41 -0800 (PST) X-Received: by 10.223.164.66 with SMTP id e2mr20781031wra.47.1487021081285; Mon, 13 Feb 2017 13:24:41 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k46si15362500wrk.55.2017.02.13.13.24.40; Mon, 13 Feb 2017 13:24:41 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@email.cz; dkim=neutral (body hash did not verify) header.i=@email.cz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=email.cz Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4AA22687EEE; Mon, 13 Feb 2017 23:24:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mxf1.seznam.cz (mxf1.seznam.cz [77.75.78.123]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E0844687ECA for ; Mon, 13 Feb 2017 23:24:25 +0200 (EET) Received: from email.seznam.cz by email-smtpc15b.ko.seznam.cz (email-smtpc15b.ko.seznam.cz [10.53.14.195]) id 5d981fd0694f07cc5d0a36dd; Mon, 13 Feb 2017 22:24:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=email.cz; s=beta; t=1487021068; bh=YzQhv5SINJIIoEnrcpmbvbT2hHSxdw3k6pvEYxUR9e8=; h=DKIM-Signature:Received:Subject:To:References:From:Message-ID: Date:User-Agent:MIME-Version:In-Reply-To:Content-Type; b=QpDRv0jLVEPfaOvnOhfWs74l5mv65VKIBC6K0AuMuQmoiZq5lv4r6k5Rszn+zCJ14 3N86dnJHvyluUfx0pFlZguqQ0JSZlmh7u/My1uEFbCpz/Kwdnp93OTY0OPYYIsnXYE MG+vGLtMpavWe3X3fpl4fAahhy+MsTijaaOVgcZI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=email.cz; s=beta; t=1487021068; bh=YzQhv5SINJIIoEnrcpmbvbT2hHSxdw3k6pvEYxUR9e8=; h=Received:Subject:To:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type; b=ajNYxhNONp7Ic3SNqenAIPYbHEeSB7QD4hIXr60gK/AWKOe03edmnUvk+KFDalQYm E0xGzLGT/64wtcIJiJ+FdQEmfMZrxAL3F291l21F5qOyuSuM6Z18bKtNMVRR+rsVTP ZLlWPNP//Mk8fFIFpXL4xGG26hf37vd3h3uIymwQ= Received: from [192.168.0.6] (ip-94-113-140-7.net.upcbroadband.cz [94.113.140.7]) by email-relay19.ko.seznam.cz (Seznam SMTPD 1.3.56) with ESMTP; Mon, 13 Feb 2017 22:24:27 +0100 (CET) To: FFmpeg development discussions and patches , timo@rothenpieler.org References: <58A0B4EE.30204@email.cz> <58A0BD35.6030702@email.cz> <58A0C8CA.9030108@email.cz> <584e2ccc-af45-2af6-659b-dc001c82057d@rothenpieler.org> <58A0CF9A.6010708@email.cz> <6056fa08-ff42-7f00-0efb-e03d08be5dc7@rothenpieler.org> <58A172F2.7040203@email.cz> <5246fa16-c71b-7757-6da7-99126e381df3@rothenpieler.org> From: =?UTF-8?Q?Miroslav_Sluge=c5=88?= Message-ID: <58A22409.8030809@email.cz> Date: Mon, 13 Feb 2017 22:24:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <5246fa16-c71b-7757-6da7-99126e381df3@rothenpieler.org> Subject: Re: [FFmpeg-devel] [PATCH] (for discussion): ffmpeg_filter: initialize cuvid for filter_complex X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Dne 13.2.2017 v 11:18 Timo Rothenpieler napsal(a): >>> That's what it looks like for me: >>> https://bpaste.net/show/890855410dac >>> >>> Happens on two independend machines, on both Windows using MSVC and >>> Linux with gcc. >>> Both machines are definitely nowehre near out of memory, on either >>> system or device memory. >>> _______________________________________________ >>> ffmpeg-devel mailing list >>> ffmpeg-devel@ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> Can't reproduce it on two my systems with same sample and same command >> line. >> >> First 1000 lines: >> 375.26: https://bpaste.net/show/bed97b3e0287 >> 378.09: https://bpaste.net/show/912c042036cd >> >> Configuration1: >> Debian Jessie Linux desktop 4.8.0-0.bpo.2-amd64 #1 SMP Debian >> 4.8.15-2~bpo8+2 (2017-01-17) x86_64 GNU/Linux >> GeForce GTX 1060, drivers 375.26 >> >> Configuration2: >> Debian Jessie Linux pascal 4.7.0-0.bpo.1-amd64 #1 SMP Debian >> 4.7.8-1~bpo8+1 (2016-10-19) x86_64 GNU/Linux >> GeForce GTX 1080, drivers 378.09 > That's not built from the right branch. > Most notably: On the filter-merge branch, the cuvid pfnSequenceCallback > happens before the "Nvenc initialized successfully", on your log Nvenc > still gets initialized first. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel It is problem in NVENC. You create first frame before initialization of NVENC in CUVID, so this first frame is not accesible to NVENC until dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context) is called in NVENC. This trivial patch should fix your problem. M. diff -Nurp a/libavcodec/nvenc.c b/libavcodec/nvenc.c --- a/libavcodec/nvenc.c 2017-02-13 22:22:37.627309692 +0100 +++ b/libavcodec/nvenc.c 2017-02-13 22:16:09.000000000 +0100 @@ -426,6 +426,8 @@ static av_cold int nvenc_setup_device(AV av_log(avctx, AV_LOG_FATAL, "Provided device doesn't support required NVENC features\n"); return ret; } + + dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context); } else { int i, nb_devices = 0;