Summary: | media-video/mpv - enable CUDA HW acceleration | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alex <fhlfibh> |
Component: | Current packages | Assignee: | Coacher <itumaykin+gentoo> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jstein, media-video, moonlapse81, proxy-maint |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | Requires ffmpeg with e6464a44 | ||
Package list: | Runtime testing required: | --- | |
Attachments: |
mpv-9999.ebuild
emerge --info Build log Configuration log for git version mpv-9999.ebuild Build.log for mpv-9999.ebuild mpv-9999.ebuild Build.log mpv-9999.ebuild WAF configuration log mpv-9999.ebuild |
Description
Alex
2016-12-28 20:33:43 UTC
Note to self: mpv-0.23.0 can dynamically load libcuda.so.1 at runtime to utilize CUDA-based video hardware acceleration. mpv still requires libavutil/hwcontext_cuda.h header, but this header is currently always installed by both ffmpeg and libav. Moreover, mpv does some tricks to avoid implicitly including cuda.h when including libavutil/hwcontext_cuda.h [1,2]. These tricks do work with current ffmpeg-git [3,4]. These tricks don't work with ffmpeg-3.2.2 [5], libav-12 [6], and current libav-git [7]. Thus, mpv currently requires both cuda.h and libcuda.so.1 for CUDA acceleration, i.e. nvidia-drivers and nvidia-cuda-toolkit. This later can be reduced to just nvidia-drivers for ffmpeg systems. [1]: https://github.com/mpv-player/mpv/blob/v0.23.0/waftools/fragments/cuda.c#L1 [2]: https://github.com/mpv-player/mpv/blob/v0.23.0/video/decode/cuda.c#L21 [3]: https://github.com/FFmpeg/FFmpeg/blob/9ec52a0a9b086d8a916a580ad594c126cd810a45/libavutil/hwcontext_cuda.h#L23 [4]: https://github.com/FFmpeg/FFmpeg/commit/e6464a44eda9503ab87bf8d2d9a878dd953be267 [5]: https://github.com/FFmpeg/FFmpeg/blob/n3.2.2/libavutil/hwcontext_cuda.h#L23 [6]: https://github.com/libav/libav/blob/v12/libavutil/hwcontext_cuda.h#L23 [7]: https://github.com/libav/libav/blob/35d1f726eb9fdd376ab900587fb02122b72f2b9a/libavutil/hwcontext_cuda.h#L23 Created attachment 457696 [details]
mpv-9999.ebuild
Please test the attached ebuild with 'cuda' USE enabled.
CUDA acceleration should work for you with it.
Hi, Tested the above mpv-999.ebuild (renamed it to 'mpv-0.23.0-r999.ebuild') in my local overlay, with GPU GTX 660, x86_64 kernel 4.4.39 and nvidia-drivers-375.26(~amd64) With 'cuda' flag enabled, the ebuild successfully pulls in nvidia-cuda-toolkit-8.0.44(~amd64). But mpv compilation fails with: ---------------------------------------------- Checking for CUDA hwaccel : no You manually enabled the feature 'cuda-hwaccel', but the autodetection check failed. * ERROR: media-video/mpv-0.23.0-r999::Local_Overlay failed (configure phase): * configure failed ---------------------------------------------- Not sure what exactly is wrong... 'emerge --info' and 'build.log' are attached. Regards, Alex Created attachment 458026 [details]
emerge --info
Created attachment 458028 [details]
Build log
UPD. Tried to build mpv from git, both master and 0.23.0 branch. Both end up with same 'autodetection check failed'. waf configuration log is attached. Maybe it might help. Created attachment 458030 [details]
Configuration log for git version
(In reply to Alex from comment #3) Thank you for testing and comprehensive info. Please save the following code to a file, e.g. test.c: #define CUDA_VERSION 7050 typedef void * CUcontext; #include <libavutil/hwcontext.h> #include <libavutil/hwcontext_cuda.h> int main(int argc, char *argv[]) { enum AVHWDeviceType type = AV_HWDEVICE_TYPE_CUDA; AVCUDADeviceContextInternal *foo; return 0; } and compile it with gcc like this `gcc test.c'. If there are any errors, please post them here. With nvidia-cuda-toolkit-8.0.44 and gcc-4.9.4 the above code snippet says the following: ---------------------------------------------- alex@genty:/tmp$ gcc test.c In file included from test.c:6:0: /usr/include/libavutil/hwcontext_cuda.h:23:18: fatal error: cuda.h: No such file or directory #include <cuda.h> ^ compilation terminated. ----------------------------------------------- UPD. Afaik, the problem is in 'hwcontext_cuda.h' In my '/usr/include/libavutil/hwcontext_cuda.h ' it says: ------------------------------------------ #ifndef AVUTIL_HWCONTEXT_CUDA_H #define AVUTIL_HWCONTEXT_CUDA_H #include <cuda.h> #include "pixfmt.h" ------------------------------------------ In ffmpeg's current git master it says: ------------------------------------------ #ifndef AVUTIL_HWCONTEXT_CUDA_H #define AVUTIL_HWCONTEXT_CUDA_H #ifndef CUDA_VERSION #include <cuda.h> #endif #include "pixfmt.h" ------------------------------------------ After copying 'hwcontext_cuda.h' from ffmeg's git, and adjusting the code snippet to use it -- the snippet compiles successfully. But this way requires too much fixing by hand, and is hardly usable practically... (In reply to Alex from comment #10) > Afaik, the problem is in 'hwcontext_cuda.h' The problem is nvidia-cuda-toolkit doesn't set C_INCLUDE_PATH, see bug 604178. Don't worry, I can probably workaround it. Great! Thanks! Created attachment 458052 [details]
mpv-9999.ebuild
Please try this updated ebuild instead.
(In reply to Coacher from comment #13) > mpv-9999.ebuild > Please try this updated ebuild instead. This one (renamed it to mpv-0.23.0-r9999.ebuild) also ends up with "autodetection check failed"... Build log is attached. Created attachment 458054 [details]
Build.log for mpv-9999.ebuild
UPD. Afaik, this looks strange in build.log: ------------------------------------------- /var/tmp/portage/media-video/mpv-0.23.0-r9999/temp/environment: line 4126: append-cflags: command not found ------------------------------------------- Created attachment 458056 [details] mpv-9999.ebuild (In reply to Alex from comment #16) > ------------------------------------------- > /var/tmp/portage/media-video/mpv-0.23.0-r9999/temp/environment: line 4126: > append-cflags: command not found > ------------------------------------------- Damn, I forgot to inherit the correct eclass for this new function. My mistake. Here's another ebuild with eclass fixed. This hopefully should just work (tm). Created attachment 458060 [details]
Build.log
(In reply to Coacher from comment #17) > Created attachment 458056 [details] > mpv-9999.ebuild > Here's another ebuild with eclass fixed. This hopefully should just work > (tm). Unfortunately, still the same "autodetection" error... Build.log is attached above. (In reply to Alex from comment #19) > Unfortunately, still the same "autodetection" error... > Build.log is attached above. Hmmm. What happens if you execute 'gcc -I/opt/cuda/include test.c' with the code snippet from comment 8? (In reply to Coacher from comment #20) > Hmmm. What happens if you execute 'gcc -I/opt/cuda/include test.c' with the > code snippet from comment 8? This way it says: -------------------------------------------------- alex@genty:/tmp$ gcc -I/opt/cuda/include test.c In file included from /usr/include/libavutil/hwcontext_cuda.h:23:0, from test.c:6: /opt/cuda/include/cuda.h:229:26: error: conflicting types for 'CUcontext' typedef struct CUctx_st *CUcontext; /**< CUDA context */ ^ test.c:3:16: note: previous declaration of 'CUcontext' was here typedef void * CUcontext; ^ test.c: In function 'main': test.c:10:5: error: unknown type name 'AVCUDADeviceContextInternal' AVCUDADeviceContextInternal *foo; ^ ----------------------------------------------------- Created attachment 458064 [details]
mpv-9999.ebuild
Ok, I see what's the problem. Please try this one.
(In reply to Coacher from comment #22) > Created attachment 458064 [details] > mpv-9999.ebuild > Ok, I see what's the problem. Please try this one. Nope, still the same error. Attached is WAF configuration log, afaik it has more information than standard build log. Created attachment 458066 [details]
WAF configuration log
Ok, we finally reached the end. mpv needs AVCUDADeviceContextInternal type, which is only available in ffmpeg-git [1,2]. Thank you very much for testing. Sorry, but you'll have to wait for the next major ffmpeg release. As soon as it arrives I'll add CUDA support to mpv ebuild. [1]: https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext_cuda.h#L37 [2]: https://github.com/FFmpeg/FFmpeg/commit/e6464a44eda9503ab87bf8d2d9a878dd953be267 Well, ok, let's wait then... If any tests will be needed, put a message here -- I will receive it by email and will make them out. Thanks a lot for your time! Regards, Alex BTW, Happy New Year, to all! (In reply to Alex from comment #26) > If any tests will be needed, put a message here -- I will receive it by > email and will make them out. I just thought that if you don't mind trying ffmpeg-9999 then I can attach another ebuild that hopefully will provide you with a working CUDA HW accel. But ffmpeg-9999 will most likely trigger a rebuild of several more packages. (In reply to Coacher from comment #28) > I just thought that if you don't mind trying ffmpeg-9999 then I can attach > another ebuild that hopefully will provide you with a working CUDA HW accel. Sure I will test it asap. Created attachment 459810 [details]
mpv-9999.ebuild
Here's an updated ebuild. You need to install ffmpeg-9999 for it. Please make sure that dev-util/nvidia-cuda-toolkit is NOT installed prior to merging this ebuild. Hopefully CUDA finally works with it.
(In reply to Coacher from comment #30) > Here's an updated ebuild. You need to install ffmpeg-9999 for it. Please > make sure that dev-util/nvidia-cuda-toolkit is NOT installed prior to > merging this ebuild. Hopefully CUDA finally works with it. Yes, CUDA now finally works! I unmerged nvidia-cuda-toolkit, installed upstream's ffmpeg-9999, and then emerged mpv with the new ebuild. It neither pulled anything else nor printed any errors on build. Whith 'vo=opengl hwdec=cuda-copy' on a h.264 video mpv now says: -------------------------------------------------------------------- [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda-copy'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [cplayer] Starting playback... [ffmpeg/video] h264_cuvid: Formats: Original: nv12 | HW: nv12 | SW: nv12 [vd] Using hardware decoding (cuda-copy). [vd] Decoder format: 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 nv12 ----------------------------------------------------------------------- Could you add these changes to future ebuilds? Thanks a lot for your help! Regards, Alex (In reply to Alex from comment #31) > Yes, CUDA now finally works! Glad to hear this :) > Could you add these changes to future ebuilds? Sure, I'll add these changes to the tree in the next few days. (In reply to Alex from comment #31) > Whith 'vo=opengl hwdec=cuda-copy' on a h.264 video mpv now says: > -------------------------------------------------------------------- > [vd] Codec list: > [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 > [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder > [vd] Opening video decoder h264 > [vd] Probing 'cuda-copy'... > [vd] Trying hardware decoding. > [vd] Using underlying hw-decoder 'h264_cuvid' > [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) > [cplayer] Starting playback... > [ffmpeg/video] h264_cuvid: Formats: Original: nv12 | HW: nv12 | SW: nv12 > [vd] Using hardware decoding (cuda-copy). > [vd] Decoder format: 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown > [vd] Using container aspect ratio. > [vf] Video filter chain: > [vf] [in] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown > [vf] [out] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown > [cplayer] VO: [opengl] 1920x1080 nv12 > ----------------------------------------------------------------------- Does '--vo=opengl --hwdec=cuda' work too? (In reply to Coacher from comment #33) > Does '--vo=opengl --hwdec=cuda' work too? With 'vo=opengl hwdec=cuda' it says this: -------------------------------------------------------- [vd] Container reported FPS: 29.970032 [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [cplayer] Starting playback... [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [ffmpeg/video] h264_cuvid: Formats: Original: cuda | HW: cuda | SW: nv12 [vd] Using hardware decoding (cuda). [vd] Decoder format: 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 cuda --------------------------------------------------------------------- It seems working too (but unlike 'cuda-copy' it says '[vd] Codec profile: unknown (0xffffff9d)') (In reply to Alex from comment #34) > (In reply to Coacher from comment #33) > > Does '--vo=opengl --hwdec=cuda' work too? > > With 'vo=opengl hwdec=cuda' it says this: > -------------------------------------------------------- > [vd] Container reported FPS: 29.970032 > [vd] Codec list: > [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 > [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder > [vd] Opening video decoder h264 > [vd] Probing 'cuda'... > [vd] Trying hardware decoding. > [vd] Using underlying hw-decoder 'h264_cuvid' > [vd] Pixel formats supported by decoder: cuda nv12 > [vd] Codec profile: unknown (0xffffff9d) > [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) > [cplayer] Starting playback... > [vd] Pixel formats supported by decoder: cuda nv12 > [vd] Codec profile: unknown (0xffffff9d) > [ffmpeg/video] h264_cuvid: Formats: Original: cuda | HW: cuda | SW: nv12 > [vd] Using hardware decoding (cuda). > [vd] Decoder format: 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited > CL=unknown > [vd] Using container aspect ratio. > [vf] Video filter chain: > [vf] [in] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown > [vf] [out] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown > [cplayer] VO: [opengl] 1920x1080 cuda > --------------------------------------------------------------------- > > It seems working too (but unlike 'cuda-copy' it says '[vd] Codec profile: > unknown (0xffffff9d)') I see. Did you use the attached ebuild as versioned one (e.g. 0.23.0-rX) or as live one (-9999)? If you haven't tried it as 9999, could please try and report back if '--vo=opengl --hwdec=cuda' still gives that error message? (In reply to Coacher from comment #35) > I see. Did you use the attached ebuild as versioned one (e.g. 0.23.0-rX) or I tried it as versioned (mpv-0.23.0-r9999) Now rebuilt it as mpv-9999-r1. It pulled mpv sources from git, and compiled without errors. CUDA seems to work as before: ------------------------------------------------------ [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [cplayer] Starting playback... [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [ffmpeg/video] h264_cuvid: Formats: Original: cuda | HW: cuda | SW: nv12 [vd] Using hardware decoding (cuda). [vd] Decoder format: 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 cuda ________________________________________________________________________ [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda-copy'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [cplayer] Starting playback... [ffmpeg/video] h264_cuvid: Formats: Original: nv12 | HW: nv12 | SW: nv12 [vd] Using hardware decoding (cuda-copy). [vd] Decoder format: 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 nv12 ----------------------------------------------------------------------- "Codec profile unknown" issue seems to be mpv's bug or something. I opened an issue on mpv's tracker https://github.com/mpv-player/mpv/issues/4040 Actually, video seems to play Ok even with "unknown" profile. (In reply to Alex from comment #37) > "Codec profile unknown" issue seems to be mpv's bug or something. > > I opened an issue on mpv's tracker > https://github.com/mpv-player/mpv/issues/4040 > > Actually, video seems to play Ok even with "unknown" profile. It seems so. I've already subscribed to that issue. Thank you very much for taking this upstream. PR: https://github.com/gentoo/gentoo/pull/3503 This PR adds cuda support only to 9999. Shortly afterwards I'll add cuda support to 0.23.0 as well, but it must be done separately. Great! Thanks a lot! CUDA support was added to 9999 in commit a8a39963a9838d60a38d6d865261698fd02b50a6 Author: Ilya Tumaykin <itumaykin@gmail.com> AuthorDate: Mon Jan 16 14:47:21 2017 +0300 Commit: David Seifert <soap@gentoo.org> CommitDate: Thu Jan 19 11:31:32 2017 +0100 media-video/mpv: support Nvidia CUDA HW acceleration in 9999 Requires ffmpeg with e6464a44, which will be available in ffmpeg-3.3 and is already available in ffmpeg-9999. Not available in libav. Many thanks to Alex (@fhlfibh) for testing. Gentoo-Bug: 603974 Package-Manager: Portage-2.3.3, Repoman-2.3.1 You'll have to first manually unmask 'cuda' USE to be able to use it, e.g. echo '>=media-video/mpv-0.23.0 -cuda' >> /etc/portage/profile/package.use.mask Once ffmpeg-3.3 is released this won't be necessary. I'll prepare a PR for 0.23.0 later today. (In reply to Coacher from comment #41) > You'll have to first manually unmask 'cuda' USE to be able to use it, e.g. > echo '>=media-video/mpv-0.23.0 -cuda' >> > /etc/portage/profile/package.use.mask Great! It now works with stock mpv-9999 and ffmpeg-9999 ebuilds: ================================================================ [cplayer] mpv git-a35a5bb (C) 2000-2017 mpv/MPlayer/mplayer2 projects [cplayer] built on Thu Jan 19 23:02:50 MSK 2017 [cplayer] ffmpeg library versions: [cplayer] libavutil 55.43.100 [cplayer] libavcodec 57.72.100 [cplayer] libavformat 57.62.100 [cplayer] libswscale 4.3.101 [cplayer] libavfilter 6.69.100 [cplayer] libswresample 2.4.100 [cplayer] ffmpeg version: N-83104-g9354049 --------------------------------------------------------------- [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda-copy'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [cplayer] Starting playback... [ffmpeg/video] h264_cuvid: Formats: Original: nv12 | HW: nv12 | SW: nv12 [vd] Using hardware decoding (cuda-copy). [vd] Decoder format: 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 nv12 ------------------------------------------------------------- [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [ffmpeg/video] h264_cuvid: Formats: Original: cuda | HW: cuda | SW: nv12 [vd] Using hardware decoding (cuda). [vd] Decoder format: 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 cuda ==================================================================== (In reply to Coacher from comment #41) > Once ffmpeg-3.3 is released this won't be necessary. I'll prepare a PR for > 0.23.0 later today. Sorry, I'm a bit delayed. But I'll add it as soon as possible. PR that brings cuda to non-9999 ebuilds: https://github.com/gentoo/gentoo/pull/3775 This took a lot of time as much more than just cuda was fixed. CUDA support is available in non-live ebuilds since 0.23.0-r1. As before you have to unmask 'cuda' USE manually until ffmpeg-3.3 is released. Alex, please give 0.23.0-r1 a try and report back. commit 7ebdf748b6c4e9869c6c984093153e14614ba19d Author: Ilya Tumaykin <itumaykin@gmail.com> AuthorDate: Thu Feb 2 18:05:49 2017 +0300 Commit: David Seifert <soap@gentoo.org> CommitDate: Sat Feb 4 22:24:52 2017 +0100 media-video/mpv: revbump to 0.23.0-r1 to sync with 9999 Among other things this brings cuda support to non-live ebuilds. Package-Manager: Portage-2.3.3, Repoman-2.3.1 (In reply to Coacher from comment #45) > CUDA support is available in non-live ebuilds since 0.23.0-r1. > As before you have to unmask 'cuda' USE manually until ffmpeg-3.3 is > released. Tested stock mpv-0.23.0-r1 with ffmpeg-9999: ----------------------------------------------------- [cplayer] mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects [cplayer] built on UNKNOWN [cplayer] ffmpeg library versions: [cplayer] libavutil 55.45.100 [cplayer] libavcodec 57.75.100 [cplayer] libavformat 57.65.100 [cplayer] libswscale 4.3.101 [cplayer] libavfilter 6.71.100 [cplayer] libswresample 2.4.100 [cplayer] ffmpeg version: N-83258-gd1df72a ---------------------------------------------------- "cuda" flag doen't work without '>=media-video/mpv-0.23.0 -cuda' in '/etc/portage/profile/package.use.mask'. With proper adjustments everything seems to work Ok: ============================================================= [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda-copy'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [ffmpeg/video] h264_cuvid: Formats: Original: nv12 | HW: nv12 | SW: nv12 [vd] Using hardware decoding (cuda-copy). [vd] Decoder format: 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 nv12 --------------------------------------------------------------- [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder [vd] Opening video decoder h264 [vd] Probing 'cuda'... [vd] Trying hardware decoding. [vd] Using underlying hw-decoder 'h264_cuvid' [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [vd] Pixel formats supported by decoder: cuda nv12 [vd] Codec profile: unknown (0xffffff9d) [ffmpeg/video] h264_cuvid: Formats: Original: cuda | HW: cuda | SW: nv12 [vd] Using hardware decoding (cuda). [vd] Decoder format: 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [vf] [out] 1920x1080 cuda[nv12] bt.709/bt.709/bt.1886/limited CL=unknown [cplayer] VO: [opengl] 1920x1080 cuda [cplayer] VO: Description: Extended OpenGL Renderer ------------------------------------------------------------------ Regards, Alex (In reply to Alex from comment #46) > (In reply to Coacher from comment #45) > With proper adjustments everything seems to work Ok Glad to hear that. Thank you very much for the extensive testing. Hello. cuda USE for mpv will be unmasked in https://github.com/gentoo/gentoo/pull/4422 *** Bug 632217 has been marked as a duplicate of this bug. *** |