-
Notifications
You must be signed in to change notification settings - Fork 855
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
WSL2 and gstreamer using nvenc and nvdec (NVIDIA's hardware acceleration) #6357
Comments
Following the installation instructions I got:
Which one is using the hardware accelaration? |
WSL2 exposes a virtual GPGPU not a hardware video codec. Legit enough as an ask, side-by-side #938 |
It is now 2021 not 2016. And we do expect to use the GPU on WSL2 in the same way we use it on the native Ubuntu. which means that important functions like hardware acceleration must be exposed and supported. As a minimum, we dont have to waste days just to find out indirectly that there is no intention to support it and it must be mentioned in the main WSL2 and NVIDIA documentation. |
For me the inability to use the hardware accelaration caused, effectively, end of my work with WSL2. We are developing Machine Learning products that generate video and if it is not possble to offload CPU to the Hardware Acceleration - there is no real reason to us WSL2. |
Just killed the use for me too. |
nvidia new driver support nvenc in wsl2 now. |
@happy2046 It'd be great if you can document the NVIDIA driver version you used. https://docs.nvidia.com/cuda/wsl-user-guide/index.html#changelog doesn't list a change to support nvenc, and the latest version listed there is 470.14, which is also the version offered from https://developer.nvidia.com/cuda/wsl/download |
Indeed. As someone said there are no plans. |
Poking around a bit, a 470.25 driver has apparently been delivered through Windows Update about two weeks ago, but hasn't appeared in NVIDIA's public documentation yet. So perhaps that fixed nvenc support? Apparently nvenc works from Windows containers with only the DirectX Class GUID (and hence user-mode display driver) exposed, which is similar (or the same) to how WSL2 GPU support works, if I recall correctly. |
I update my driver from windows update. |
Note that in all previous version ffmpeg reported existance of nvenc but when trying to use it ffmpeg have an exception. Did you actually try it ? Best, |
@tadam98 Did the previous versions of the driver include If not, then it's newly-implemented in 470.25, and my guess would be that ffmpeg was picking up a copy of So if you test with NVIDIA driver 470.25, make sure it's picking up the host-mount |
The very first driver with WSL2 support from NVIDIA didn't even have DirectML support, only CUDA and in the following drivers they added more features like DirectML, D3D12, NVENC... etc Just tried this with my GT 710 (driver 470.25) in WSL2 and looking at Task Manager it truly used the NVENC engine. |
Thanks for the confirm, ono. Available on WSL2 21362+ with a commensurate 5.10.16 kernel. Further issues over at WSLg. /fixed |
This bug or feature request originally submitted has been addressed in whole or in part. Related or ongoing bug or feature gaps should be opened as a new issue submission if one does not already exist. Thank you! |
@therealkenc I lost the thread on what I was trying to do when I made my previous comment, but it looks like
Does this mean that VA-API encode acceleration is now supported in ffmpeg under WSL2? (If not, new ticket? Here or over at the WSLg tracker, which currently has no tickets for ffmpeg?) Also, what about QSV? I don't see any mention of QSV in either place. |
What this means is the singular identifiable repro in this issue submission, which was
If you can demonstrate a misbehavior in VA-API encode acceleration with a repro, yes, a new ticket, in principle.
That's a good question. As of this writing we're still tagging (GP)GPU submissions in this tracker. Meaning, to a first order, for practical purposes, NVIDIA and AMD WSL2 kernel layer driver related issues. WSLg is, narrowly speaking, at least arguably about Wayland and Pulse (plus other goodies), or colloquially "GUI apps". Running |
I think VA-API is completely distinct from this ticket, because they are Intel encoding acceleration APIs, and will depend on Intel either providing an appropriate user-mode library to redirect the API into the exported DirectX minidriver (which is what NVidia have done with libnvidia-encode.so.1 bundled in the driver), or to somehow provide a /dev/dri device that does the same, so that the current native VA-API user-mode library works. That's assuming that va-api is a user-mode shared library like nvenc is; if it's compiled into ffmpeg to call /dev/dri, then only the latter option is open. Making nvenc work didn't require /dev/dri (and I don't think nvenc on Linux ever used /dev/dri, but I might be wrong about that), so I think this ticket was not really a replacement for #4700. |
Upgraded to windows 11 insider version 21H2 (OS Build 22000.120)
The nvidia versions:
checks:gstreamer check:
ffmpeg check
HW acceleration is not detected. |
I suspect
means that ffmpeg binary does not have NVENC support compiled in. So you'll need to either build your own, using e.g. this quite long process; or use some one else's build, e.g. this PPA. |
Gstreamer too ?
|
Yup, I don't see the gstreamer plugin there, but it also wasn't listed in the working example earlier: #6357 (comment) There's instructions for compiling and installing the nvenc plugin for GStreamer at https://gist.github.com/corenel/a615b6f7eb5b5425aa49343a7b409200. 30 seconds of poking around didn't find a PPA for this plugin, so I'd suggest focussing on getting ffmpeg working first. Then you'll know that the WSL side works, and you can then build the GStreamer plugin and get it working too. |
Procedure for ffmpeg worked find. I removed the default ffmpeg and installed.
Procedure for getreamer fails. See [https://gist.github.com/corenel/a615b6f7eb5b5425aa49343a7b409200] |
Good, so the WSL/nvenc setup is working, and so for GStreamer, someone needs to work out the right combination of libraries and checkouts to build under Ubuntu 18.04 with CUDA 11.4. Your linked gist comment suggests to me that something in that gst-plugins-bad repo needs a newer compiler than comes with Ubuntu 18.04, but I have neither here to check that, so am just guessing. This is probably the wrong place to work it out, since it's distro-specific, and application specific, and this closed bug was tracking the WSL2 plumbing side of the feature, which is working. |
I put it in Gstreamer rather than in wsl2 as indeed it does not belong in wsl2. I would try it with CUDA 10.2 as well. The issue is that the gstreamer does not compile with the provided procedure which is not WSL2 issue.
|
I can confirm that in 2022, we finally have this working. I was live-streaming from Coachella ~2016 and so badly wanted nvenc access in Docker, but alas it was WAY too soon. I'm now running a container on Win10 21H2 with WSL2, and |
Hi,
The instllation instructions of https://developer.nvidia.com/embedded/dlc/l4t-accelerated-gstreamer-guide-32-1 do not end up with a working use of nvend and nvdec.
See https://www.collabora.com/news-and-blog/blog/2020/03/19/getting-started-with-gstreamer-gst-build/?quip_approved=0#quip-success-qcom
and https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/142
Futher input is very welcomed.
Best,
Mickey
The text was updated successfully, but these errors were encountered: