-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neither CUDA nor NVDEC will enable on Windows #5978
Comments
Encoding works fine when ffmpeg is compiled with --enable-nvenc and --enable-cuvid
Decoding with nvenc also works btw, you just need to install the SDK. |
Thanks for responding, but this is confusing. First, I'm not encoding anything. Second, the mpv manual says to use hwdec=cuda with vo=gpu. This is the method used for all hwdec, in the manual. It works with other decoders but not cuda or nvdec. Has something changed that hasn't been updated in the manual? |
cuda & nvdec only work with --gpu-api=opengl |
I believe I tried that, with no success. I will retest, when I get a chance. Thank you. |
Just tested with gpu-api=opengl with cuda and nvdec. No change. They will not enable. Other guys I've talked to online, also can't get them to enable. |
You're right, doesn't work here either with @shinchiro 's build while it works with self compiled build on Linux. |
Still not working in the 2018-07-14 build |
Works here. https://i.imgur.com/bOWgOJb.jpg OS: Arch Linux 4.17.5, 1080-Ti 11G
MPV stdout:
I also have
and got around 250fps on 3840*2160 UHD. All seems to be fine on this end. I think it just depends on your build and having the right libraries installed. |
Uh, I'll explicitly add |
I think I also used |
@shinchiro , unfortunately, cuda nor nvdec are still not enabling in your latest build :( |
Just realized, it's always enable before. I believe you need to download/install cuda toolkit (~1.5GB) to use it. |
So to use nvdec or cuda, the cuda toolkit needs to be installed? The manual needs to be amended, to inform the user to do this. As is, the manual states that you can simply enable it. https://mpv.io/manual/stable/#options-hwdec cuda: requires --vo=gpu (Any platform CUDA is available) |
@shinchiro . I installed it, no change. It still doesn't enable. |
I don't think that something cuda/nvdec related is missing, as -copy modes work. It rather seems to me that something interop related doesn't work with Windows builds. |
This is what I see in the log [ 0.233][v][vd] Codec list: |
It isn't enabling in 0.29, either |
This is not a Windows only problem. I have the same problem in archlinux, reverted to 0.28 where it works fine. |
Weird that the Arch repo build is affected, it works here with this adjusted pkgbuild of mpv-build-git: |
Not to be a pain, but is there any development on on this? Is this an OS issue? |
@Doofussy2 Maybe you can set the message level to trace to see at which function it failed exactly: mpv/video/out/opengl/hwdec_cuda.c Line 61 in 07915b1
|
Thanks @tomty89 I'm going to add --msg-level=all=trace to the mpv.conf, then post the log UPDATE: |
@Doofussy2 |
Thanks @tomty89. Here's the log with that, using @shinchiro's build, trying to use hwdec=cuda |
Somehow the message level was not increased in this part:
Maybe we need |
That appears to be giving the same output, but here it is |
Hmm what about |
I think what is probably required, is this --msg-level=vo/gpu=trace. Which makes this log. I'm not sure it provides any more info, though. |
Hello, |
Is there anything else I can provide, to help? @lachs0r? |
It's btw. fixed with latest repo build on Arch. |
I did some research and can't find any windows build with nvdec or cuda actually working (recent or past @lachs0r or @shinchiro builds) In recent builds, the issue doesn't seem to be the same: @lachs0r: [vd] Codec list: |
Those lines say that @lachs0r build doesn't have the cuda hwdec built into it but the @shinchiro ones does. So you need to focus on the @shinchiro one. You need to turn the logging all the way up to TRACE and see what else it says when it tries to load it. I would expect it's saying it can't find the right dlls. Please grab the additional logs and add them here. |
there isn't more information with --msg-level=all=trace: BUT: i realized that hwdecode is actually working with --hwdec=auto: |
I've tried trace logs in previous posts, but it doesn't reveal any more information. Is there a specific expression to expand the GPU logging? |
@prowal Yeah, in the auto case it's using d3d11va, which is a perfectly reasonable choice. When you guys say you used trace logging, I really expect to see other stuff. There should be some lines from the cuda hwdec after it says "Loading hwdec driver 'cuda-nvdec'. I see these on linux. |
Is it not generating more because it isn't being enabled, or is it actually the logging that needs augmenting? The log does say it's trying to load cuda-nvdec, but it shows it failing. But no logging to indicate why.
|
So, on my linux system where this works, I see:
The ways it can fail before |
Interesting. Maybe Linux has more tools to be able to analyze more thoroughly? |
@philipl on my windows system, it failed at mpv/video/out/opengl/hwdec_cuda.c Line 100 in 104b510
so the CHECK_CU function never called in the first place. Of course, the dlls is there as ffmpeg can find it
|
Here's the extracted symbols found in nvcuda.dll (version, 398.36): https://0x0.st/sELa.txt I did compared the symbols with the one in Here's the symbols lines which absent in the dll |
The symbols that don't exist in the dll are loaded using LOAD_SYMBOL_OPT so they should not cause a loading failure. @shinchiro, you have built ffmpeg with the same headers version right? If the 'nvdec-copy' hwdec loads successfully, that means ffmpeg was able to load the symbols, but you really should see the same success or failure. Can you try that? |
yeah,
The error before came from hwdec |
Ok, I went and dug out my windows installation and updated drivers, etc, etc. The first observation for everyone who isn't @shinchiro is you must set your --gpu-api=opengl and you must make sure it uses the 'win' context rather than angle. Interop only works with the real system opengl and angle wraps directx. Based on the errors I saw, I think this is why people don't see any error messages. When I switched my backend and context correct, I saw what @shinchiro saw - nvdec-copy works with symbol loading and nvdec does not. In my case I also saw a specific error (I think it prints to stdout which is why @shinchiro may have missed it) that said it can't load cuInit. That basically must mean it can't find nvcuda.dll or it's finding the wrong one. The dll finding logic is in the headers and should be the same in both ffmpeg and mpv. So that's weird. @BtbN, any thoughts? |
Continuing. the headers do symbol loading in a simplified way vs ffmpeg, and this is probably where the difference comes from. I guess it's too simple to actually work on windows. |
@BtbN found and fixed the problem. FFmpeg/nv-codec-headers@5054a06 @shinchiro if you rebuild with the new nv-codec-headers, it should start working. |
Yeah, that fixed it 👍 |
I'm genuinely baffled how this did not cause a single warning.
Would have expected a huge bunch of compile errors, but no, nothing.
|
Thanks for figuring it out, guys. I look forward to testing it |
I'm a little confused. First, nvdec is working as expected. But I'm not sure cuda, is. This is what I see in the log [ 0.413][v][vd] Opening decoder hevc And the stats says it isn't. |
That's a 10bit encoding and your hardware doesn't support decoding those, so it's correctly falling back to software. |
That's not true. I get hwdec with nvdec, nvdec-copy, cuda-copy, auto-copy, d3d11va and d3d11va-copy. cuda is the only one that fails. log with nvdec enabled [ 0.648][i][vd] Using hardware decoding (nvdec). |
I think I see why. I was starting playback with --fs. If I start playback without that, cuda is enabled. |
Looking at your full log, yes, what I see is it trying to use cuda and then that failing. Specifically:
I can somewhat imagine this is related to --fs being used, but I'm surprised to hear it. Note that the difference between |
Yeah, I used to enable cuda/cuda-copy for the deinterlacing feature, but then discovered that cuda/cuda-copy can't decode half of my HDR stuff. The picture breaks up, very badly, and freezes. All other decoders are just fine. So I won't be using cuda, I just thought I'd bring it to your attention, in case there was problem. It definitely doesn't work with --fs. Thanks for all the good work, guys. |
There definitely seem to be nvidia parser/codec issues with HDR stuff. I've seen it too, but fortunately there's no interlaced HDR :-) I'm glad it's working reasonably now. |
Ha! Yeah, I've had some major issues with deinterlacing. I've had to make auto-profiles, to work around it. Thanks again |
I hope @lachs0r will add this to the next release :) |
A quick revision for enabling cuda. I thought it was --fs that was causing the problem, but it looks like it's more to do with full frame 4k HDR. If I play a cropped 4k HDR video, cuda is enabled. If I play a full frame 4k HDR, it doesn't enable. With 4k SDR, it appears to work ok. |
Latest Git build, but it's been this way for as long as I've had my GTX 1050 (a few months)
Windows 10
Reproduction steps
Using hwdec=cuda or hwdec=nvdec in the mpv.conf, results in software decoding. But cuda-copy and nvdec-copy, work
Expected behavior
Hardware decoding
Portable mpv log.txt
I've also reported this Nvidia, in case it's a driver issue.
The text was updated successfully, but these errors were encountered: