-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
chromium: enable vaapi/hw-accel #57837
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
Conversation
I have spare CPU power for a while, too. If having pre-built binaries will expedite the review/merge process, let me know and I can build these commits on top of |
does this include / supersede #56973? |
@bendlas It entirely replaces #56973. Just in the interest of rationalizing yet another chromium vaapi PR --- That PR is out of date, and as far as I know, didn't receive testing of each build output due to the long build times. On the other hand, this is using today's Chromium channel builds, I have tested the four important outputs, is simpler, and includes the ozone functionality. I'm hoping it's an easy merge so we can get this in and start iterating. |
5935f5d
to
fef0334
Compare
I'd prefer to keep PRs separate, when possible. Still, this PR is looking pretty good, IMO (thanks for the flag names) I want to verify, that turning useVaapi=false doesn't result in derivation changes (for 19.03). Barring any objections, I'll merge this in the evening. |
@bendlas Does it make maintenance easier if I split these? I don't mind doing so. I'm putting final touches on nixos-unstable builds and instructions for testing, I can go ahead and pull out the Ozone commit. At the very least, it would be a fun test of derivation changes, and might make the PR more appealing to you? |
pkgs/applications/networking/browsers/chromium/upstream-info.nix
Outdated
Show resolved
Hide resolved
It does make maintenance both easier and harder (more branches), in a way, but it reduces the potential for having multiple discussions going on in a single issue thread and most importantly, it separates the PR's life cycles, so an issue with one feature won't hold up progress / merging of the other. In any case, your version of vaapi seems to address all the open issues in #56973, whereas progress on that ticket seems to have stalled, so I'm willing to merge this, but will wait a bit for feedback .. |
I have added testing instructions to the OP with pre-built binaries so everyone can test without needing to build Chromium multiple times. I also have this same PR but without Ozone and without the version bump: https://github.com/colemickens/nixpkgs/commits/chromium-upstream1. This resulted in new wrappers for stable/beta, and new wrappers/builds for dev/ Thanks @bendlas! |
The VAAPI parts looks like what I would've done. |
I'm getting a crash to desktop whenever I click on any of the links on this site. The same does not happen with unstable. Stacktrace
|
Doesn't crash for me, but vaapi doesn't seem to work at all
This happens on my PC with nvidia card, as well as on my laptop with intel GPU |
fef0334
to
30c91d4
Compare
Thanks for the update, to reduce the scope to just vaapi! I've built your latest version and the If you want to test for yourself, you can install my build:
and run it by
|
Maybe it still needs |
Sorry, that was my bad. I rebuilt with Updated build is at |
@bendlas Before I dig into this, can you confirm if libva is working on your system? |
I set it up according to your instructions here https://nixos.wiki/wiki/Accelerated_Video_Playback and vainfo shows the intel drm driver |
|
Okay @bendlas. Thank you for testing and patience, I will try to take a look at this tonight and provide an update. |
30c91d4
to
3faa778
Compare
3faa778
to
4a27575
Compare
@bendlas Okay, I've pushed it again, here's a screenshot of it working again. I had dropped an important line when rebasing/splitting the PR. Rebuilt against nixos-unstable again. This should get you the same build and leverage my cache:
and then invoke it: |
(This would just be a wrapper rebuild, but |
@hyperfekt When I click on those h265 videos, they download. When I use In fact, looking at the logs, it seems that it falls through the Mojo decoder, attempts the ffmpeg decoder and then reports an error (with or without my change):
Screenshot of This makes me more suspicious that the ffmpeg used by chromium is built without x265 support or something like that? FINAL EDIT: I don't think we should expect Chromium to play HEVC content. We are (1) not using the system ffmpeg, and (2) we are not enable manual HEVC support. See here for more: shaka-project/shaka-packager#501 (comment) |
Yeah, I didn't necessarily expect them to play (as you noticed chromium without the change just downloads), but I also didn't expect them to crash chromium. Strange that you can't reproduce. |
I didn't see any chromium crashes and my laptop is now able to play videos through the Mojo Decoder. Merged to master. Thanks! |
This broke video decoding on my 2011 laptop with a Radeon HD 6470M. I used Workaround is to disable chrome://flags/#disable-accelerated-video-decode |
Yeah, that's what I was afraid of .. probably the reason that other distros deactivated it again .. I think we might have to disable it by default as well ... |
I wonder if it's viable for us to maintain our own whitelist for devices we confirm it works with. |
@ivan Thanks for the video, that was interesting to see. I'm sorry to hear that it is broken, maybe we should flip @hyperfekt This is an interesting idea. I wonder if we should try to get in touch or start a "common thread" for distro Chromium-package maintainers to discuss best approaches. The patch currently excludes Nvidia, maybe it should exclude all non-Intel -- https://github.com/NixOS/nixpkgs/pull/57837/files#diff-58a5fed9a4a5453d7f82957c8a706606R111 ? Alternatively, we leave I think I prefer the last option, personally, but would need some time to try to make the necessary changes and it would mean we're diverging from the patch that other distros are carrying. |
I think the last option is a great idea, since both actually testing all platforms we would like this to be available for and having users compile their own version don't seem like really good solutions. |
this fixes playback on radeon see #57837 (comment)
I think it would be good not to hard - code any device whitelist into chromium, so this option seems best to me (or rather: create a patch, applying on top of the common - distro one) Multiple chromium builds are out of the question, unless we can find a cheap way to derive them from a single nix build. |
Also: do we need a patch, or can this be done in the wrapper? https://www.chromium.org/developers/how-tos/run-chromium-with-flags |
@bendlas I was wondering something similar - can we do something to "enable" the disable flag by default? Otherwise the extra patch is going to be a bit larger than I was thinking, if we have to actually reverse the flag and change all the places the flag is used. I saw that you went ahead and disabled it for now, thanks. I'll probably leave this for a few days at least, and try to get some input from the Arch packager in the meantime, etc. |
Motivation for this change
This adds to the chromium derivations:
useVaapi
- Includes the patch to enable vaapi-powered hardware acceleration for Linux by default.I have tested with all revisions of the browser. You can see screenshots:
TESTING
I have built this exact branch (currently rebased on top of
nixos-unstable
, but targettingmaster
).Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)