-
Notifications
You must be signed in to change notification settings - Fork 127
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
h264 support for GM45 chipset #544
Comments
Hi! It looks that the GM45 is a Gen4 chipset and this one is now also supported by the new crocus Gallium driver. VA-API support for this driver was recently added which is confirmed here. However the corresponding patch was merged after the current libva 2.13. So there is needed first a new libva version, - maybe @XinfengZhang can say when we will see this? It should be noted that also some oibaf PPA Ubuntu users are awaiting this eagerly.:wink: |
I'm using Xubuntu 22.04, which has the new Intel Crocus driver enabled by default (Mesa 22.0.1), with an Intel GMA 4500 MHD. The VA-API driver works but h264 decoding support is not indicated:
The Intel GMA 4500 MHD supports h264 video decoding, the VA-API driver is useless in this case. Are there any plans to add h264 video decoding? |
I'm now using the crocus driver and vainfo still tells me that h264 decode is not supported. So it seems that it didn't fix anything. However playing videos in mpv now seems to allow me to playback h264 content smoothly even though it is telling me that h264 is not supported. So maybe the crocus driver is doing it's job ? idk I just gave up honestly. |
As I understand it, libva is using the I returned to Debian 11 as it is lighter than Xubuntu, I hope h264 decoding will finally be implemented, in time for the release of Debian 12 (mid 2023). Honestly I'm pretty skeptical as we're talking about an integrated graphics card from 2009, and if h264 decoding hasn't been implemented so far, I doubt it ever will. The solution would be to reinstall Windows 7, with the official drivers I could force the h264 codec to YouTube and take advantage of the hardware decoding (it would make the CPU less hot). The h264 decoding also works on Windows 10 with modified drivers, but with Windows 10 the CPU is always at 100% usage so I'm not going to reinstall it. I even forced a Windows 11 installation with the same modified drivers, here too the h264 decoding works and the CPU usage is lower, setting maximum performance (turning off animations, shadows, transparencies, etc) also works decently but File Explorer has been slowed down a lot, it's super slow to do anything. |
Okay, just be clear, the corresponding VAAPI support with crocus should be present since #547 and Libva 2.14.0. However, I can confirm that the crocus VAAPI support seems to be still somehow flawed. This is the case also for my 6th generation Intel "Sandy Bridge" HD 2000 based system. It looks that the corresponding Regarding the even older Intel GMA 4500 MHD which is a 4th generation Intel iGPU it is possible that it is simply unsupported. Maybe we ask @XinfengZhang and @airlied what the exact status of VAAPI support with crocus is. And maybe there should be pushed a new intel-vaapi-driver package, version 2.4.1 seems to be effectively outdated. @Kappa971, I don't think that Windows could be here a solution. Windows 7 is since quite some time EOL and Windows 10 is also nearing its end. Even if this sounds strange, I use Kubuntu 20.04 LTS even on quite old DX9 class hardware. I just have to set the compositing to OpenGL ES 2.0 with EGL via the "KWIN_COMPOSE=O2ES" environment variable. With that setting, KDE is almost as fast as LXQt or the former LXDE. And I think this will be also true for the upcoming Kubuntu 22.04 LTS. 😉 |
I don't think
The chip is very old, it would not surprise me if it wasn't supported, however I think that the h264 hardware decoding support is very important in this case, as it would drain the CPU from this task... it would be possible for example to see a video on YouTube in h264 1080p 30fps offloading much of the work on integrated graphics (1080p 60fps is too much for this chip).
I agree with this, but unfortunately the Intel GMA 4500 MHD h264 hardware decoding currently only works on Windows (and if you want to have a usable PC, the choice falls on Windows 7). |
Using proprietary software is definitely not a solution. Anyways my solution was just to compile my entire system with O3, LTO, PGO and other optimizations, use dwm and make a script that turns off my compositor when mpv opens (Yup this is what it takes to get smooth video playback, I know it sounds ridiculous). The most annoying thing about all of this is that the support is there, there is fork or branch of this repo with h264 support for these chips and the only thing left to do is merge it into the main branch. All the work has already been done and implemented aghhh. |
All this, in addition to being complex, is impractical. What I want to do is watch YouTube videos with the internet browser, without external programs like mpv or VLC. Obviously, with these programs the CPU usage is lower and allows you to see these videos in a decent way, but it is not the definitive solution to this problem. The simplest solution (which even a mere mortal can do) is currently installing Windows 7 with official drivers, as it has h264 decoding support. I know that Windows 7 is no longer updated and it is a security risk, but this also affects Android phones, but no one cares there if you don't have the latest security patch (on my phone for example it dates back to February 2019, so it's as vulnerable as Windows 7, and millions of other smartphones as well). I would like to clarify that I use Tampermonkey to load a script to force YouTube to use the h264 codec (this limits the videos to 1080p60, but on the other hand this GPU can't handle beyond that).
According to this site https://issues.guix.gnu.org/38403, there appear to have been problems since the introduction of the kernel 5.x |
well in my case it's much more convenient to use mpv. I don't have a youtube account. I just subscribe to rss feeds in newsboat and when I press "w" it opens the video. For me not using windows isn't even that much about the security updates. It's just a garbage operating system where you can't get any work done. On top of that it's bloated proprietary spyware that would render my machine absolutely useless since the idle cpu usage will be 80% and just sitting on the desktop uses 4gb of ram. iirc there was a script to open youtube videos in mpv from your browser if you really want to use your browser. |
I used to be a fan of Windows, but I'm not anymore due to the ridiculous requirements of Windows 11 (Microsoft only wants to create e-waste, even if they consider themselves environmentally friendly), but having said that I don't agree on what you wrote. Going back to the issue, I hope someone will find a solution to take advantage of h264 hardware decoding on this chip, considering the power of these CPU and GPU, take advantage of hardware decoding in Linux would be very useful. |
Hi, I also have a laptop with GM45 GPU. I'm using Linux Mint 20 and I can confirm that vainfo gives the same output (only MPEG-2 Dec) also here.
@Kappa971 |
No developers replied here after 4 months, so I'm pretty pessimistic. It's a shame because h264 decoding is the only useful thing this useless GPU can do 😅.
Here you will find everything: https://www.tenforums.com/graphic-cards/167898-custom-driver-intel-gma-4500-m-mhd-extreme-plus-2-nighmayor.html. |
It should be noted that the GM45 iGPU is for a long long time EOL and as of 2022 no Intel developer will care about this. 😉 However, because this matter is open source a technically skilled person can independently add GM45 VAAPI support. This was already done once by Gentoo developer @ConiKost (see first link in the first post of @leg7). But that work never got merged back into the official intel-vaapi-driver for whatever reasons. Most likely this was because of some fundamental changes in the VA-API framework on later 5.x Linux kernels which made the GM45 VAAPI modifications again incompatible. So in the end, even more adjustments would have been necessary to get this working again. |
I absolutely don't expect an Intel developer to add h264 decoding support in the GM45 chipset (on the other hand they want to sell the new hardware), the hope falls on an independent/enthusiast developer. Also the Intel gen4 GPU graphics driver has been updated lately (although i don't know if from intel), I don't expect the VA-API driver to be updated too but I hope so 🙂.
I also read on this site (https://issues.guix.gnu.org/38403) about problems with the 5.x kernel. The last message is from January 2022, then nothing more. |
Thanks Kappa for your answer. I'll soon try the drivers on Windows. Actually, I have a Core 2 Duo as CPU and for my use case (pretty much studying, pdf, word...) is more than enough even though Win7 was much better. If this driver thing works I should be able to use this pc for 99% of my work.
Indeed 😭 Hi, @lorn10 thanks for your reply. I know, GM45 GPUs are outdated and for years I simply lost any hope, but recently I accidentally found several posts like this one, that were recent, like, this is from january of this year, and I saw a sparkle of hope again. |
No, not really ;-) I only created the ebuild for the unofficial https://bitbucket.org/alium/g45-h264 repo, which contained the patched g45 driver with h264 support. I never patched the source code. But repo seems pretty dead and unmaintained. |
It's too bad that some unfortunate default memory allocation setting stalemated this. |
If you know what you're talking about why don't you do a PR? Because otherwise I believe that unfortunately no one is interested in solving this problem |
People on the AUR reported that to work just fine 3 months ago. So eventually, I feel like this is the usual *buntu inter-dependencies clusterfuck. |
|
I already addressed both above. I don't remember where I read that DVMT/pre-allocation helped with decoding, but I know at least some people fixed issues this way. Or perhaps it was people exceeding the Dual Engine capabilities (presumably 1080p at 30fps) to cause problems..idk. |
That driver doesn't exist of Debian / Ubuntu distributions (I didn't find it) so it doesn't matter to me, unless they make it officially available.
Always better than just having the h262 decode. The Intel GMA4500MHD is perfectly capable of handling h264 1080p 30fps videos. |
Then that's your problem, duh? It's not anything here to be "old" (hell, it's not even about patches being required, it's just a matter of rebuilding).
Yes, I know. And some people even reported youtube videos (which I assume are 30fps) were playing just smooth in mpv/vlc. |
This driver isn't in the official package, and it isn't present in Debian/Ubuntu and therefore is a big problem. What are the most popular Linux distributions? 😅
As I said before, if you know what you are talking about, why don't you contribute? I don't go into certain topics because I don't know enough.
I have owned this laptop since 2010 (with Windows), I remember that until 2013 I could easily watch videos on YouTube in 1080p (there were only those at 30 fps). Then they changed the codec, and now a script is needed to force YouTube to use the h264 codec (with, for example, Tampermonkey). In any case it is useless to continue talking about it, I personally don't have the knowledge to be able to deal with this problem, I only reported it as others here. |
Because, even when the code first dropped 11 years ago, it was more of a "last stretch" of support for older hardware. And once they pushed it out of the door, despite actually maintaining the thing on life support more or less through the end of 2014, nobody was ever really paid enough to investigate further problems. Which at the same time were allegedly serious enough not to warrant merging.
.... as you can see from the second link in this thread, and the last one before my first post, people have been forward porting this patch until last year (and with activity waning here, further care shouldn't even be needed anymore)
Because 1) I'm not linuxing as of lately. 2) there's nothing to even contribute to begin with, if these are really the premises
IIRC it was only in 2015 that they switched everything to VP9. 2013 was only the date they started with testing (and you don't need special scripts.. just disabling av1 and vp9 support in the browser should be enough, if a bit rough)
It doesn't help that there's a ton of confusion about the extent of "full acceleration" even inside intel's own docs and claims.
Switch to anything that supports the AUR (if you cannot be bothered to learn the existential nightmare that apt is, which I cannot blame you) and start to churn out field feedback. |
In the last link I shared, the last comment dates back to January 2022 but development may have stopped for years, I don't know. Also they talked about compatibility issues with the kernel 5.x so I don't know how this works on Arch.
As mentioned before, they talked about problems with the kernel 5.x, how is it possible that on Arch Linux it works? In any case, I don't use this PC very much, I tried Linux to make it still usable but the lack of h264 decoding is quite serious, the CPU is not fast enough to make up for this. The choice fell on Debian (with Xfce) because it is very light (more than Xubuntu) and because it requires practically no maintenance (unlike Arch). |
For the love of god, there's nothing left to develop. At least to get the barest acceleration, at least assuming my VRAM assumption holds.
They also reported some nuisance there, but putting aside latest posters seemed to do just fine, nobody forces you on any kernel.
Either by 5.16 everything was nice and dandy again, or @ViNi-Arco forget to mention they were using some LTS kernel.
The only problem with arch is the elitist first install experience that takes you an afternoon to do the same things that windows 95 could already handle by itself. It doesn't really take any particular "maintenance" after that. |
hi all, i am not Intel's developer, i am just a maintainer for AUR, so i am not able develop this old driver. I was in contact with Intel's developer, the support of 264 on G45 was never perfect, they held it outside master in extra branch, but later (in year 2018?) they deleted this branch too. Intel's developer send me patches, so i was able with help keep it. But i have no G45 anymore, and i don't know, if it works or not. |
I also had the same impression, but was anything mentioned about VRAM/DVMT? |
Hi @alium, I have an old laptop with gm45 (Intel GMA 4500MHD) with Debian 11 (kernel 5.10), if you want I can try your driver (but you should tell me what to do). Maybe you could upload it to GitHub so maybe someone more experienced can help solve the issues? |
|
Hi all again, just a couple of points.
|
I compiled the driver on Debian 11 i965_drv_video.so.zip. I have never compiled a Linux driver in my life, I copied it where the original driver was (making a backup) in
Unfortunately the h264 decoding doesn't work in any way (am I doing something wrong?).
It doesn't work in MPV:
EDIT |
Big_Buck_Bunny_1080_10s_30MB.mp4 is encoded with the H264 high profile at 5.1 level. |
Anyway if this video doesn't work, I don't think others will work (2022 videos).
In VLC I selected vaapi as video decoding and the log shows it, the driver is simply not working (it doesn't work for me). |
Big buck bunny is an open-source film, most of times explicitly designed and shipped as a benchmark?
I'm just spitballing really. For as much as I know, it could be DVMT isn't as (duh) dynamic in linux.
They suggested |
The problem isn't high resources, it's not using the gpu for decoding at all.
|
With VLC, this is the only H264 video test is trying to use hardware decoding (without success): https://drive.google.com/file/d/0BwxFVkl63-lEbFBzak1sbmU1N0E/view?usp=sharing&resourcekey=0-GOK3gZYAmP-ywn6T9zCDoQ (Taken from here: https://kodi.wiki/view/Samples). Intel_gpu_top shows the use of hardware ( So I think this driver is broken, the only solution would be to switch back to Windows (as mentioned above). |
Here follows the *.mov version of Big Buck Bunny: big_buck_bunny_1080p_h264_AAC.mov. I think that one should be compressed with "normal h264 settings". 😉 PS It runs great at all my Radeon HD GPUs, even at the very first UVD1 based one from 2007. 👍 |
Thanks @lorn10 but by now I have removed the driver and I don't think I'll try it again, it's not able to do what I need. Even if this video worked, most of the other videos don't work and it doesn't work with YouTube either. I'm convinced that with Windows h264 decoding would have worked with all tested videos, but I don't want to reinstall Windows. 😅
Your GPU probably has a vaapi driver with h264 decoding support. |
Okay, however I don't think this is the end in this topic. Maybe someone techie enough "will come along the road" and will get this working also with newer kernels. If this works on Windows it can and should also work on Linux. 😉 Alternatively someone could also launch a little $/€ awarded "Get VAAPI working on Gen4 GM45 project". So I mean somewhat in the sense of Patreon but the other way around, "Idea/Project is searching devs". 😃 |
I never expected this issue to blow up so much, I expected at most 2 replies. I think a bounty could be a good idea. I have no experience writing drivers so sadly I cannot be of any help at the moment, though I am sure this wouldn't be that hard of a job for someone knowledgeable. Maybe since this issue has caught so much traction intel will do something about it, although I doubt that they will do anything. |
I'm writing this on my Thinkpad X301. I know this is old, but I'm very fond of it and I'm sure lots of machines of this vintage are still floating around, so fixing the drivers is still a worthy project. Fully upgraded (mine has 8GB of RAM and a 400GB SSD) it's still quite useful if you understand its limitations. There is nothing I'd like more than having a fully functional Linux setup. That'd allow me to keep using in when Windows goes EOL. I'm unfamiliar with Linux development, specially drivers, but I did a fair amount of programming back when I was younger. I understand how interrupts work, how to modify registers at special memory address and the like. I know both C/C++ and x86 assembly. If someone is kind enough to guide me through it, I'm sure I could fix what is broken. It shouldn't be too complicated as the driver is already complete. I already complied the driver and gives me this input:
Bit it doesn't seem to work. |
I would really really like to contribute to this if I could. But I have zero understanding of programming... However, perhaps this topic will now get some attention from the Intel devs. And maybe @mirh can make some noise, it looks that he has clearly a higher "dev-ping reputation" then me. 😉 |
Although not related to video decoding, it'll also be a good opportunity to try to improve the driver support level. I'd like to raise awareness over the fact that GM45 (et al) is a Shader Model 4.0 ship and, according to this page, it should support OpenGL 3.3 instead of 2.1. It's just that intel got lazy and decided not to expose certain functionalities via OpenGL in a classic example of planned obsolescence. OpenGL 2.1 is considered obsolete but not OpenGL 3.3. Fully supporting the chip capabilities via OpenGL / ES should allow people to run contemporary software such as Mozilla Firefox or Blender with full hardware acceleration, to the level of performance the hardware allows, of course. This is essential to keep this machines alive, since they are limited in their capabilities and specially sensitive to performance issues that arise from CPU based emulation. |
@m1kemex you might think that, but it really isn't capable of GL 3.3. GL 3.0 requires minimum MSAA 4x support, the GPU doesn't have that, neither does Ironlake. Sandybridge is the first Intel GPU with 4xMSAA. |
Yes, it's a weird chip, and slow, but nevertheless overall "modern". As far as I know, Mesa emulates missing capabilities, so making a fully conforming driver isn't an issue. Most people do not need strict conformance, though, so a driver parameter could be used to disable MSAA (and other workarounds) and get full performance for general usage. Performance in Windows is quite acceptable for such an old hardware. This is strictly a software issue. |
it's not possible to "emulate" MSAA. Mesa doesn't emulate missing capabilities. |
Back in the day I did a bit of programming with OpenGL 1.x and, as far as I can remember, Mesa was a software implementation of OpenGL. DRI was developed as an interface to offload some parts of the pipeline to actual hardware via "hooks" and enhance performance. This is an hybrid model, with some parts of the pipeline running in the CPU and some in the GPU (I do remember Mesa explicitly reporting the GPU model and the CPU features it was using, like SSE). Therefore, Mesa was capable of compensating for some missing features, by emulating them in software. I don't think any of this has changed; what changed is that every modern computer comes with a GPU now and thus software rendering is rarely used. I just checked and Mesa implements OpenGL 3.1, so newer DRI drivers probably don't contain any software emulation code by now. They just report what they support, like on Windows. But they are still built using Mesa framework, so, in theory, it is always possible to make it work as it used to be. Or, if it becomes problematic to mix both things, then MSAA can be silently disabled (report capability and all, but do nothing). I also checked on OpenGL anti-aliasing and I don't think having MSAA enabled is critical for an application. It'd be just a matter of losing some rendering quality. I could be wrong. Like I said, all my knowledge is from like 15-20 years ago and before shaders were even invented. But the fact remains that the GPU works reasonably good on Windows via DirectX (Firefox on WIndows 10 uses hardware acceleration for everything). So there must be a way to get the same level of performance in Linux. |
actually gm45 doesn't have geometry shader hardware either. so it's very far out as those are needed for 3.2 Mesa doesn't work like you think it does anymore. It doesn't work to mix sw and non-sw rendering paths in modern GPUs. In old GPUs the mix was only around whether vertex shading was on the CPU or could be done on the GPU. |
You shouldn't assume that dx10=ogl3.3.
Sure, but wasn't it you to to add https://github.com/mesa3d/mesa/commit/76ba50a25a8bbc1e5fbcdb24da7e09f8996cf2c5?
It's not, but the opengl spec had kind of an idiot ball there, and it's required for opengl 3.
|
About a year later, I think this issue is dead/in limbo, especially on kernel 5.x? |
I don't think kernel has anything to do with it (I mean, video acceleration that is). Anyhow, I just gave this a try.. and it failed spectacularly (so much so that I'm even wondering if I had in fact tested it once upon a time?). Everything hangs the moment the first frame should appear, until the session crashes.
By all means, it shouldn't land with these quirks. Unless somebody can reliably track them down. For example, graphics mode select only goes up to [Enabled, 128MB] on my motherboard bios. But from the registers doc I know 256MB should also be a thing (which seems indeed exactly what one of the comments in my links above mentioned too). |
I came across your topic by accident. I have an old LG R510 on GM45 with a hacked (essentially) BIOS (from which you can switch the graphics size, but I haven’t heard about the 256MB mode), kernel 6.6.2, Intel P9700, 8GB of RAM, with Archlinux and the libva-intel-driver-g45-h264(AUR). I have never really tested the actual operation of h264 decoding, so I decided to check (since I found your topic) through vlc and a 1080p video test. The video plays, there are errors in the terminal, the processor is not heavily loaded, sometimes there may be an artifact when rewinding the video, but in general everything is fine (I also know that h264 encoding will definitely not work adequately with this driver). |
To be super duper fair, my P5QPL-AM is powered by a G41 (which has a X4500, not a full-ass 4500MHD). p.s. hw-accelerated encoding was only added in sandy bridge |
"p.s. hw-accelerated encoding added only to Sandy Bridge": As for the BIOS, initially there was nothing in it, and then I started hacking it and it turned out that there was nothing there except engineering things. And I tried all possible settings in it, and it was so long ago that I don’t even remember about video graphics, but I left the DVMT item blocked (it seemed to be faulty). And as far as I know, DVMT was installed automatically (in this BIOS) depending on the RAM, you will have to try to somehow remove the RAM and check again. (And the “pre-allocated memory (32/64/128 MB)” item worked fine and I left it.) |
I only see VAEntrypointVLD entries in your vainfo output. That def shouldn't be happening?
I see.. So maybe the big crux isn't even allocated memory (save perhaps for very stupidly low quantities?) but just me having G45 is what allowed them to handwave in the docs that there isn't any significant decoding difference between the two gen 4.5 generations, meanwhile the marketing material was always tiptoeing around the fact that H264 acceleration is just "partial" for the lower-end skus (either by claiming that only 1080p isn't feasible, by winking that blu-ray playback depends on "system configuration", by neglecting to mention what codec was effectively possible to fully accelerate, or by calling it a day already with just motion compensation like they had done with G35 and VC-1). Otherwise I don't really have any other theory to explain these differences. |
I absolutely love this thread and you guys. :D I recently got my hands on a laptop with this chipset, well to be precise the GL40. But I think it is the Cantiga 4500MHD (or 4500M, there is some conflicting info on the web...) But this ticket would most likely affect this chipset. I upgraded the cpu to a t8300 and ram to 6gb and started testing how usable this hw is ar rhis time. I can get youtube 720p30 processor @about 40%, 720p60 processor @about 60-70%, 1080p30 and cpu is jumping between 70-90% and it only gets a little choppy @1080p60 (Cpu full load), but IT'S SO CLOSE. Intel gpu top shows much 3d rendering, but no video... I guess you guys get the same thing... And undoubtedly proper video decoding would push it over the edge. Now obviously i don't want to blast the cpu @100% for some video and the fans blazing. So any improvement would be greatly appreciated and would make this laptop all that anyone (at least myself would ever need)... I was thinking about switching to arch to get that patched driver, but i might as well try to build it with this to test if that helps anyone. Running kernel 5.15 zorin lite 16.3. All in all I wanted to add myself to this thread, to see where it goes in the future. This hardware is completely usable, still... |
EDIT: There was no build instructions and was trying to build it through the typical ./configure, make way which ended in errors, but finally realized I need to be using Meson... So will report back soon... Ok, so after using Meson, I got it to build. I had to build the older 2.4.0. package, because there was some incompatibility with the VAdriverinit function version or something, so vainfo was throwing errors... I copied the driver to my dri folder and with the 2.4.0. package i get: But I'm not seeing any difference. I'm not able to get any movement in the intel_gpu_top video/0 indicator, no matter what i do. All i get is 3d rendering... |
Docs say you may need EDIT: and you could try some other (progressive?) video, even my nvidia card on windows somehow didn't felt like wanting to accelerate 1080i-25-H264.mkv |
Hello, I am not sure if this is the place to ask but I have read that there used to h264 support for the GM45 chipset on a different branch of this repo but it has since been deleted.
https://forums.gentoo.org/viewtopic-t-925258.html
http://www.linuxsystems.it/2012/05/gentoo-g45-gm45-h264-vaapi-video-decoding/
https://aur.archlinux.org/packages/libva-intel-driver-g45-h264/
https://01.org/linuxmedia/vaapi
Could anyone help me find this branch or clear up what has happened since the time these threads have been made?
I'm trying to get support for this on Gentoo and currently it doesn't work with the latest libva and intel-vaapi-driver.
The text was updated successfully, but these errors were encountered: