-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Support]: Need libmfxgen1 library installed to support Alder Lake CPU QSV transcoding #3170
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Have you tried the latest beta version to see if this is still an issue? |
I manually upgraded my kernel to 5.18, upgraded Ubuntu to the latest release (22.04 Jammy Jellyfish), and switched to the latest beta image (https://hub.docker.com/layers/frigate/blakeblackshear/frigate/0.11.0-beta2/images/sha256-ae2cd475eedbf6d72d81069ee304152951af7c865aae2936183036e55912089c?context=explore) After that I re-enabled QSV hardware encoding to h264 from my HEVC streams and it all appears to be functional! I've confirmed via intel_gpu_top that the hardware encoder is getting utilized and my CPU utilization is low even after pumping up the output to full 4k encodings. It's been running for a few hours with no hang ups, but I'll let you know if there are any more crashes. Thanks! |
@robdoug89
|
@robdoug89 can you share the steps you followed? I am still struggling to get qsv enabled for decode on my streams. I followed your steps - ubuntu 22.04 (clean install), upgrade kernel mainline to 5.18, install To start, I verified that everything was working on the host, and hit the ubuntu bug you listed earlier. But once
And it worked correctly, and used quicksync as verified by load in However, in the frigate container Logs from command:
repeated for every sample:
finishing with:
I tried installing in-container device permission
|
@charlesmunger what does your docker-compose file look like? I had to add:
to mine before it started working. Though it looks like from the logs the frigate container's ffmpeg is already attempting to look in the right spot Additionally, I'm still on '0.11.0-beta2' (which is still working for me) What does your frigate config look like for the ffmpeg section? Under record I'm using:
in your vf section looks like ffmpeg is transferring the stream to/from the QSV chip to system memory. I removed all of that since it didn't appear necessary to move the stream when the encoding was happening on the chip |
OK, I've tested all the beta versions of 0.11.0 and... I got beta2 to work with vaapi (working images, intel_gpu_top confirms hwaccel), the other betas (1, 3, 4) fail with a green screen and error logs. Config: hwaccel_args: &hwaccel_args
- -hwaccel
- vaapi
- -vaapi_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p Same config, everything else identical but running a different beta version:
So something in beta2 made it work, that then regressed in beta 3. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ok, I got qsv hwaccel "working" on beta7 with this config: hwaccel_args:
- -hwaccel
- qsv
- -qsv_device
- /dev/dri/renderD128
- -hwaccel_output_format
- qsv
- -c:v
- h264_qsv
- -gpu_copy
- "on"
output_args:
detect: -vf vpp_qsv=format=yuv420p -f rawvideo -pix_fmt yuv420p This does result in CPU improvement and I do see activity in I also tried I think we should consider updating the docs since I suspect that users of that configuration are not actually getting hardware acceleration - if I didn't specify I was also tripped up by the yaml converting |
@charlesmunger any other settings you're using to make this work? Upgraded to an Alder Lake CPU recently and have similar to issues. With your settings, I get green screens and errors.
|
That's the full config that works for me. If you run |
Hmm, not many specific errors (maybe I can increase the verbosity):
|
thanks @charlesmunger, debug config: https://gist.github.com/jasonmadigan/75dfadef3703a3a13ef732bd4788539a |
@jasonmadigan That config is still using vaapi, not the qsv config in #3170 (comment) |
@charlesmunger sorry, switched back to the old config to get things up and running again. Debug with the QSV settings (and green cameras): https://gist.github.com/jasonmadigan/75dfadef3703a3a13ef732bd4788539a Log output is much the same, no real info in the errors from ffmpeg. |
Update: nevermind, think I figured it out. Unraid currently ( |
That's great to hear! One more suggestion though - you don't appear to be using substreams for your cams. If you did, it'd mean less work to decode. You could:
|
For a docs update, sounds like we need:
Unfortunately this involves overriding a big chunk of frigate's built in ffmpeg args creation. My final configuration:
I'll take a stab at a docs update PR. |
Seems this would be an additional section just for 12th gen, haven't seen previous gen (even 11th) having to use these args Feel free to do this or perhaps I'll work on something myself, but I think we might want to re-organize these args. Especially as we are getting more and more variations figured out per generation of intel and encoding, I think a table or some other visual organization would help so it isn't a long list of potential exceptions. |
Where does one find information on Unraid 6.11 beta? haven't seen anything on it |
It's in test, Unraid don't seem to publicise these as much as the RCs, but there were some links shared on their forums by someone. Install Plugin > https://s3.amazonaws.com/dnld.lime-technology.com/test/unRAIDServer.plg |
As a last addendum, the current recommendation for hardware acceleration with qsv does not work - "Unlike most other values, this option does not enable accelerated decoding". Even when I had it set up with proper filters/hwdownload, I didn't see a CPU reduction, and I was unable to get rid of approx. 2.5 seconds of latency, even with lots of tuning. |
This is done automatically in 0.12 with the ffmpeg presets |
Describe the problem you are having
I have an Alder Lake gen12 CPU that I'm utilizing QuickSync for hardware transcoding.
In order to use the qsv device, the Docker image needs to have libmfxgen1 installed as per the Intel compatibility matrix
The stock Docker image will fail to initialize the hardware encoder/decoders using qsv if this package is not installed (see general Ubuntu bug)
After adding the[ Intel repository](deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main) and installing libmfxgen1 via apt-get results in the ffmpeg instance being able to correctly utilize qsv.
Version
0.10.1-83481AF
Frigate config file
Relevant log output
FFprobe output from your camera
.
Frigate stats
No response
Operating system
Other Linux
Install method
Docker Compose
Coral version
M.2
Network connection
Wired
Camera make and model
.
Any other information that may be helpful
No response
The text was updated successfully, but these errors were encountered: