Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 679840 - media-video/handbrake-1.2.2 - ./libhb/nvenc_common.c:14:10: fatal error: ffnvcodec/nvEncodeAPI.h: No such file or directory
Summary: media-video/handbrake-1.2.2 - ./libhb/nvenc_common.c:14:10: fatal error: ffnv...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ian Whyman (thev00d00) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-09 11:52 UTC by Tomasz Golinski
Modified: 2019-03-10 17:35 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log.gz,4.35 KB, application/gzip)
2019-03-09 11:52 UTC, Tomasz Golinski
Details
GNUmakefile (GNUmakefile.gz,1.32 KB, application/gzip)
2019-03-09 11:53 UTC, Tomasz Golinski
Details
handbrake-1.2.2-r1.ebuild (handbrake-1.2.2-r1.ebuild,3.72 KB, text/plain)
2019-03-09 18:22 UTC, Louis Sautier (sbraz)
Details
prepatch of the ebuild with disabled nvenc (handbreak-1.2.2-r1.ebuild,763 bytes, patch)
2019-03-09 22:29 UTC, Ulenrich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Golinski 2019-03-09 11:52:31 UTC
Created attachment 568286 [details]
build log

For some reason handbrake requires Nvidia nvenc support while building:

../libhb/nvenc_common.c:14:10: fatal error: ffnvcodec/nvEncodeAPI.h: No such file or directory
 #include <ffnvcodec/nvEncodeAPI.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Ebuild probably needs a USE flag to disable nvenc dependency.
Comment 1 Tomasz Golinski 2019-03-09 11:53:00 UTC
Created attachment 568288 [details]
GNUmakefile
Comment 2 edes 2019-03-09 12:24:56 UTC
same problem here.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2019-03-09 12:33:03 UTC
media-libs/nv-codec-headers provides that header as well.
Comment 4 edes 2019-03-09 13:27:19 UTC
Handbrake-1.2.2 has a new --enable-nvenc configure option. The ebuild should have a USE flag to enable or disable nvenc, as Tomasz suggested?

--
Comment 5 Ulenrich 2019-03-09 14:20:18 UTC
(In reply to edes from comment #4)
> Handbrake-1.2.2 has a new --enable-nvenc configure option. The ebuild should
> have a USE flag to enable or disable nvenc, as Tomasz suggested?

Not as easy as @edes suggests: Introducing a 
USE nvenc and the corresping line for $(use_enable nvenc) 
gives me:
---
configure.py: error: no such option: --disable-nvenc
 * ERROR: media-video/handbrake-1.2.2::pmaci failed (configure phase):
 *   Configure failed.
 * 
 * Call stack:
 *     ebuild.sh, line 124:  Called src_configure
 *   environment, line 3644:  Called die
 * The specific snippet of code:
 *       ./configure --force --verbose --prefix="${EPREFIX}/usr" --disable-gtk-update-checks $(use_enable libav-aac ffmpeg-aac) $(use_enable fdk fdk-aac) $(use_enable gtk) $(use_enable nvenc) $(usex !gstreamer --disable-gst) $(use_enable x265) || die "Configure failed."
Comment 6 andcycle-gentoo.bugs 2019-03-09 17:32:59 UTC
the upstream doesn't have --disable-nvenc in configure, 

so it require patch to fix the upstream code or just make hard dependency on media-libs/nv-codec-headers first then figure out proper solution later.
Comment 7 Tomasz Golinski 2019-03-09 17:55:16 UTC
Well, looking at make/configure.py it seems they really support only --enable-nvenc. I don't know enough Python syntax to follow but it seems it should be disabled by default. However it is not and "FEATURE.nvenc              = 1" turns out in GNUmakefile. 

Changing that line in GNUmakefile seems to fix the problem, so maybe the ebuild should do a simple sed if USE=-nvenc.
Comment 8 Louis Sautier (sbraz) gentoo-dev 2019-03-09 18:22:27 UTC
Created attachment 568330 [details]
handbrake-1.2.2-r1.ebuild

Upstream added the --disable-nvenc flag in c7119499f5a2da7e5be0afd50a6757778fed53e7

You can save https://github.com/HandBrake/HandBrake/commit/c7119499f5a2da7e5be0afd50a6757778fed53e7.patch as files/handbrake-1.2.2-allow-disabling-hardware-encoders.patch and try this ebuild with USE=-nvenc.

It's just a WIP, I haven't added the proper dependencies for nvenc. The other codecs probably also need to be explicitly enabled/disabled based on use flags.
Comment 9 Ulenrich 2019-03-09 22:15:31 UTC
I also inserted this line in src_configure():"           $(use_enable nvenc) \"
The patch works with disabled -nvenc:
---
[ebuild     U  ] media-video/handbrake-1.2.2::pmaci [1.1.2::gentoo] USE="fdk gstreamer gtk -libav -libav-aac -nvenc% x265" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) media-video/handbrake-1.2.2::pmaci
>>> Installing (1 of 1) media-video/handbrake-1.2.2::pmaci
---
Comment 10 Ulenrich 2019-03-09 22:29:00 UTC
Created attachment 568362 [details, diff]
prepatch of the ebuild with disabled nvenc
Comment 11 Ulenrich 2019-03-09 22:31:05 UTC
Sorry, bad description above:
ebuild patch for to emerge with USE -nvenc
Comment 12 Larry the Git Cow gentoo-dev 2019-03-10 17:35:36 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a16187c2c99bd6900494d5e8c7d3dd9ccb67672

commit 2a16187c2c99bd6900494d5e8c7d3dd9ccb67672
Author:     Ian Whyman <thev00d00@gentoo.org>
AuthorDate: 2019-03-10 17:34:32 +0000
Commit:     Ian Whyman <thev00d00@gentoo.org>
CommitDate: 2019-03-10 17:34:56 +0000

    media-video/handbrake: Fix nvenc build failure
    
    Backport patch from upstream to allow enable/disable nvenc, qsv encoding
    
    Closes: https://bugs.gentoo.org/679840
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Ian Whyman <thev00d00@gentoo.org>

 ...ndbrake-1.2.2-backport-hardware-configure.patch | 88 ++++++++++++++++++++++
 ...rake-1.2.2.ebuild => handbrake-1.2.2-r1.ebuild} |  8 +-
 media-video/handbrake/metadata.xml                 |  1 +
 3 files changed, 96 insertions(+), 1 deletion(-)