mpv icon indicating copy to clipboard operation
mpv copied to clipboard

autodetecting cuda fails during configure

Open voltmtr opened this issue 9 years ago • 4 comments

mpv version and platform

mpv and ffmpeg git master on linux (ubuntu 17.04)

Reproduction steps

cuda autodetection of mpv fails during ./waf configure even though ffmpeg is compiled with cuda and cuvid support. Same behavior when using mpv-build or manual configure.

Expected behavior

cuda autodetected

Actual behavior

cuda autodetection fails. Bisected this behavior to commit https://github.com/mpv-player/mpv/commit/dc5fcced233ac4c9f2d644cbfc246644a095f673 changes to cuda.c fragment, specifically lines

AVCodecContext *avctx = avcodec_alloc_context3(NULL);
avctx->hw_device_ctx = NULL;

to confirm when these are removed autodetecting succeeds.

Possible solution

Adding libavcodec to cuda use part in wscript seems to solve this

    }, {
        'name': '--cuda-hwaccel',
        'desc': 'CUDA hwaccel',
        'deps': 'gl',
        'func': check_cc(fragment=load_fragment('cuda.c'),
             use=['libav', 'libavcodec']),
    }

when both libav and libavcodec is in use part cuda can be autodected on my system else it always fails.

voltmtr avatar Oct 13 '17 15:10 voltmtr

It's detected with ffmpeg master here. Can't reproduce.

ghost avatar Oct 13 '17 16:10 ghost

I get the same issue and a suggested workaround does help.

odysei avatar Oct 20 '17 13:10 odysei

I also have a similar issue. The only difference is that I'm explicitly setting --enable-cuda-hwaccel, and not using the autodetection.

CUDA is not detected by waf configure.

The proposed solution of modifying wscript to use=['libav', 'libavcodec'] in --cuda-hwaccel section works for me.

dbermond avatar Nov 01 '17 19:11 dbermond

Commit https://github.com/mpv-player/mpv/commit/09c61347a8481cfb42bfc381880bd3fe93c4e744 fixed this issue for me.

dbermond avatar Nov 03 '17 00:11 dbermond