Skip to content
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

IGPU frequency stuck at 1GHz when using hardware video decode with Apple GuC #800

Closed
tiger511 opened this issue Apr 4, 2020 · 57 comments
Closed
Labels
help wanted Extra attention is needed project:green

Comments

@tiger511
Copy link

tiger511 commented Apr 4, 2020

Here is how to reproduce:

  1. Use latest whatevergreen

  2. Use igfxfw=2 boot arg

  3. Open safari

  4. Watch a streaming .eg: https://mixer.com/shroud?vod=xjN2eVd4SUCLiQ00iU-CLw

5)GPU frequency will reach 1GHz and stuck there

Then even closing safari doesn't fix this.GPU stuck at full frequency until sleep/reboot.Looks like using GPU decode breaks something which causes the iGPU to stay at high frequency even on idle.

My hardware: i7-8750h
iGPU: Intel UHD 630

@vit9696
Copy link
Contributor

vit9696 commented Apr 4, 2020

Well, we cannot control what Intel firmware does and how it interfaces with the operating system. Most likely the same issue happens with real macs. I can leave this open with help wanted, but we do not plan to explore it ourselves.

@vit9696 vit9696 added the help wanted Extra attention is needed label Apr 4, 2020
@Andrey1970AppleLife
Copy link
Contributor

We don't approve content distribution 18+

@tiger511
Copy link
Author

tiger511 commented Apr 4, 2020

We don't approve content distribution 18+

You mean the example link? It's a game streaming video.I don't see how is this 18+ content.

@vit9696
Copy link
Contributor

vit9696 commented Apr 4, 2020

@Andrey1970AppleLife it is just some game children play, no porn or such, the prompt at the website is misleading. Let's have the issue open if somebody could contribute more technical information.

@vit9696 vit9696 reopened this Apr 4, 2020
@tiger511
Copy link
Author

tiger511 commented Apr 4, 2020

Well, we cannot control what Intel firmware does and how it interfaces with the operating system. Most likely the same issue happens with real macs. I can leave this open with help wanted, but we do not plan to explore it ourselves.

I don't think same happens with real macs.Even playing any video in apple tv does the same too.Sleep or Reboot cycle fixes it.I have to figure out if its related to Apple GuC or no.i suppose igfxfw=5 will use host preemptive firmware without apple GuC?

@vit9696
Copy link
Contributor

vit9696 commented Apr 4, 2020

Correct, removing igfxfw=2 will also work the same way.

@Mateo1234454545
Copy link

Mine Intel UHD620 goes up to 0,15ghz and then drops to 0 after video exit.

@tiger511
Copy link
Author

tiger511 commented Apr 4, 2020

Okay i confirmed my theory.This bug is related to GuC only.When i'm using Host preemptive scheduler,it works fine.But When i load Apple GuC with igfxfw=2 boot args, playing above video in safari make it stuck in highest turbo boost GPU frequency.Sleep/wake reloads the GuC firmware (I found it in kernel log )and it goes back to normal.

Without GuC:
Screen Shot 2020-04-04 at 7 16 29 PM

With GuC:
Screen Shot 2020-04-04 at 7 31 57 PM

With GuC Even after quitting all app,still stuck at high frequency:
Screen Shot 2020-04-04 at 7 32 10 PM

I have macbook air 2014 to test on.But since it's preskylake, it doesn't support GuC.Unfortunately i don't have any other real mac with post skylake hardware to test it.Maybe someone can test it for us?

@tiger511
Copy link
Author

tiger511 commented Apr 4, 2020

Mine Intel UHD620 goes up to 0,15ghz and then drops to 0 after video exit.

Are you using latest Whatevergreen from master branch with igfxfw=2 boot args?

@Mateo1234454545
Copy link

Mine Intel UHD620 goes up to 0,15ghz and then drops to 0 after video exit.

Are you using latest Whatevergreen from master branch with igfxfw=2 boot args?

I'm using latest kext but without igfxfw argument.

@tiger511
Copy link
Author

tiger511 commented Apr 4, 2020

I'm using latest kext but without igfxfw argument.

can you please use that boot arg and let me know if your gpu behaves normal with above video in safari.

@JosephDuffy
Copy link

JosephDuffy commented Apr 8, 2020

I'll try and add what I can to this:

I'm using latest WhateverGreen with igfxfw=2 shikigva=80 boot args. I have an i9-9900k (UHD630), an RX 580, and a Z390 motherboard.

The linked video in Safari does not cause the GFX frequency to go up at all. Although I can't get DRM content (e.g. Amazon Prime Video) to play in Safari so perhaps Safari isn't using the iGPU at all(?)

When playing a very high bitrate video (400mbps HEVC) in VLC there's a small ramp up, then it stays at 1.2GHz (I assume the max), then when it's finished it goes back down to 0.

Screenshot 2020-04-08 at 18 30 17

If I play a video in Firefox (e.g. Twitch) the iGPU will go up and down, but I've never even seen it go above 1GHz.

Screenshot 2020-04-08 at 16 14 34

Note that prior to the latest WhateverGreen version – and without igfxfw=2 – I cannot play the 400mbps HEVC video for more than a couple of seconds before it pauses. So for me this update has massively improved my iGPU performance 🙌

It I manage to get DRM content to play in Safari (I had it work once, but after a reboot it started failing) I'll provide an update regarding the original video posted here.

@tiger511
Copy link
Author

tiger511 commented Apr 8, 2020

@JosephDuffy I don't think GuC firmware is loading for you.Did you check log to see which firmware is loaded for iGPU? Use this command to check:
log show --last=boot|grep -i igpu
Also your monior connected to AMD GPU or iGPU?

@JosephDuffy
Copy link

JosephDuffy commented Apr 9, 2020

@JosephDuffy I don't think GuC firmware is loading for you.Did you check log to see which firmware is loaded for iGPU? Use this command to check:
log show --last=boot|grep -i igpu
Also your monior connected to AMD GPU or iGPU?

In that output I have kernel: (AppleIntelKBLGraphics) [IGPU] Graphics accelerator is using scheduler: Apple Firmware.

The system logs in Hackintool contains kernel[0]: (AppleIntelKBLGraphics) <AppleIntelKBLGraphics`IGGuC::loadBinary(bool)> [IGPU] Graphics Firmware Version: 2.14.0.0.

@tiger511
Copy link
Author

tiger511 commented Apr 9, 2020

Then it is indeed using Apple GuC.What looked weird to me in your graph is "GFX REQ" and "GFX AVG".Usually when i use GuC, both of them show somewhat same number.When GPU is not in use GFX REQ shows 0. But without GuC, GFX REQ usually shows "0.35" or a higher number with a straight line like your pic.

@JosephDuffy
Copy link

Then it is indeed using Apple GuC.What looked weird to me in your graph is "GFX REQ" and "GFX AVG".Usually when i use GuC, both of them show somewhat same number.When GPU is not in use GFX REQ shows 0. But without GuC, GFX REQ usually shows "0.35" or a higher number with a straight line like your pic.

GFX req is always 1.2GHz, which I thought was odd, but other than no DRM in Safari (which also doesn't work without Apple GuC) it all seems to work. 1.2GHz seems to be the max my iGPU will go up to.

@Utmostmao
Copy link

I encountered the same problem.
GPU frequency will reach 1GHz and stuck there.(When opening the app store and playing video ads)

@chromer030
Copy link

I also tested and have this problem , when opening App Store and playing ads , GPU frequency stuck at 1GHZ , my build is Skylake based.

@Andrey1970AppleLife Andrey1970AppleLife changed the title iGPU frequency stuck at 1GHz when using GPU video decode IGPU frequency stuck at 1GHz when using hardware video decode with Apple GuC Apr 18, 2020
@vasishath
Copy link

I also tested and have this problem , when opening App Store and playing ads , GPU frequency stuck at 1GHZ , my build is Skylake based.

How did u manage to enable GuC loading on skylake ? AFAIK, it loads only on 300 series chipset and later

@07151129
Copy link

Can you post the kernel log that includes the moment when after stopping a video the frequency becomes stuck? I would also need a relevant timestamp (hour and minute).

@nickhx
Copy link

nickhx commented Jun 28, 2020

Hi, I get the following error message in the kernel log as soon as I kill the window in Safari running the above test...

error 19:52:30.266223+0100 symptomsd received unknown kernel SysInfo stat '96' -> '0'
default 19:52:31.039201+0100 kernel [IGFB][ERROR ] updateSliceConfig Requesting Invalid Slice Count
default 19:52:31.039211+0100 kernel [IGFB][ERROR ] updateSliceConfig Requesting Invalid EU Count

@07151129
Copy link

07151129 commented Jun 28, 2020

Can you please post a complete log obtained from running log show --predicate 'process == "kernel"' --last boot --style syslog? Make sure you boot with debug_agpm=0xffffffff agpmlogmask=0xffffffff boot args.

@nickhx
Copy link

nickhx commented Jun 28, 2020

No problem, kernel log attached. I started the above website just after 20:05 and then closed the window at 20:06. Let me know if you need anything else.

kernellog.log

@vit9696 vit9696 closed this as completed Aug 9, 2020
@zombillano
Copy link

Why did you close this if is still unsolved?. I wasn't using igfxfw at all and I had this issue

@Mateo1234454545
Copy link

It has nothing to do with boot-args like igfxfw.
My guess is that something is broken with the latest commits of whatevergreen.

@zombillano
Copy link

@vit9696 I found that WEG 14.0 doesn't have this issue. Could you reopen this one so we can give some more details and try to find a solution? My theory is that the changes made to adapt WEG to Big Sur broke something and it causes the high GPU load even on idle. This has nothing to do with boot-args.

@vit9696
Copy link
Contributor

vit9696 commented Aug 13, 2020

WEG 1.4.1 got new IGPU performance control support, which you can disable igfxnorspc=1, this is documented.

@Mateo1234454545
Copy link

WEG 1.4.1 got new IGPU performance control support, which you can disable igfxnorspc=1, this is documented.

Doesn't solve the problem.

Booted with igfxnorspc=1 boot-arg on Big Sur.
Watched a video on safari and then closed the lid.
When waking from sleep gpu was stuck at max 1.1.ghz making laptop unussable.
Had to rebbot.

@tiger511
Copy link
Author

WEG 1.4.1 got new IGPU performance control support, which you can disable igfxnorspc=1, this is documented.

Doesn't solve the problem.

Booted with igfxnorspc=1 boot-arg on Big Sur.
Watched a video on safari and then closed the lid.
When waking from sleep gpu was stuck at max 1.1.ghz making laptop unussable.
Had to rebbot.

With igfxnorspc=11 flag you have disabled the new performance control.You have to remove this arg.

@vit9696
Copy link
Contributor

vit9696 commented Aug 13, 2020

Hrm. So, do you all confirm that WhateverGreen 1.4.0 works correctly? Please confirm that. Afterwards, please find the commit where things broke for you. You can get prebuilt binaries for every commit here.

@tiger511
Copy link
Author

Hrm. So, do you all confirm that WhateverGreen 1.4.0 works correctly? Please confirm that. Afterwards, please find the commit where things broke for you. You can get prebuilt binaries for every commit here.

I dont think that's the case.This issue exists since version 1.3.8 till current version 1.4.1 . By the way in WEG 1.4.1 , what difference does it make if we use igfxfw=2 ? Does it load Apple GuC without this flag?

@vit9696
Copy link
Contributor

vit9696 commented Aug 13, 2020

Hrm, I am afraid there is some level of confusion here.

  1. Apple GuC, enabled exclusively by igfxfw=2 boot argument and disabled by default is bugged, and will eventually lead to IGPU locking at high frequency. This thing is not planned to be investigated or fixed.
  2. CPU scheduling performance was fixed by WEG 1.4.0 allowing the IGPU frequency to reach high values without GuC. This is enabled by default and can be disabled by igfxnorspc=1. We believe it works correctly.
  3. Without igfxfw=2 and with igfxnorspc=1 WEG 1.4.1 should also work correctly, but the IGPU will not be able to reach high frequencies.

If you believe that anything of the three does not hold, please provide more detail.

@cattyhouse
Copy link
Contributor

B360M-HDV, i5-8400, no problem here:

WEG: 1.4.1
During Quicktime Screen recording: GFX AVG 1.05 , GFX REQ: 1.03
After Quitting Quicktime: GFX AVG 0.00 , GFX REQ: 1.03

@Mateo1234454545
Copy link

I compiled a kext before commit :acidanthera/WhateverGreen@6a1990e

and till now everything is fine. Needs more time though becasue the problem doesn't occureverytime after waking.

Please try it and see fr yourself.
acidanthera/WhateverGreen@6a1990e

note: with this version I have noticed better power management , too. With 1.4.1 fans and temps were getting crazy when wathcing video.

@07151129
Copy link

07151129 commented Aug 13, 2020

CPU scheduling performance was fixed by WEG 1.4.0 allowing the IGPU frequency to reach high values without GuC. This is enabled by default and can be disabled by igfxnorspc=1. We believe it works correctly.

It's igfxnorpsc. In my experiments the frequency went down just fine due to forcewake clears, so it was OK to request maximum frequency all the time, but I guess for some users some domain bits get never cleared. Unfortunately, I don't think I can reproduce this on my machine. This behaviour may be specific to 10.16.

@zombillano
Copy link

zombillano commented Aug 13, 2020

Hrm. So, do you all confirm that WhateverGreen 1.4.0 works correctly? Please confirm that.

It does, indeed. Will try to see which commit broke the functionallity.

B360M-HDV, i5-8400, no problem here.

Yours uses UHD 630 but the desktop variant. AFAIK this may be affecting only laptops, at least I have only seen that problem on laptops.

Needs more time though becasue the problem doesn't occureverytime after waking.

I can trigger it by changing resolution or speed while seeing videos on youtube, give it a try.

note: with this version I have noticed better power management , too. With 1.4.1 fans and temps were getting crazy when wathcing video.

Most likely your issue with temps is caused by getting stuck at high frequencies which makes the whole system consume more energy and therefore getting hot, not because "bad" power management on 1.4.1.

I think the best that I can do is explain my setup:

  • i7 8650u - UHD 620 (so, mobile variant)
  • I don't have any boot args
  • I use the recommended device-id and AAPL,ig-platform-id that appears here

What I mean with this is that the problems I have with 1.4.1 are not caused by any misconfiguration or boot-args.

CPU scheduling performance was fixed by WEG 1.4.0 allowing the IGPU frequency to reach high values without GuC. This is enabled by default and can be disabled by igfxnorspc=1. We believe it works correctly.

This behaviour may be specific to 10.16.

I'm on 10.15.6, so it isn't 10.16 only. I think that the modifications on the code to make WEG work with 10.16 is what caused this issues, will try to see which commit causes that.

@Mateo1234454545
Copy link

I can trigger it by changing resolution or speed while seeing videos on youtube, give it a try.

Tried. No problem with the kext I uploaded.

Most likely your issue with temps is caused by getting stuck at high frequencies which makes the whole system consume more energy and therefore getting hot, not because "bad" power management on 1.4.1.

No , that's not the case. Even when gpu isn't stuck at max , when watching a video or opening an app , gpu behaves "abnormaly" and causes temps to go up. First time I heard the fans go to max speed when just watching video (with WEG 1.4.1 and Big Sur).

What I mean with this is that the problems I have with 1.4.1 are not caused by any misconfiguration or boot-args.

I agree on that.

@Mateo1234454545
Copy link

I'm on 10.15.6, so it isn't 10.16 only. I think that the modifications on the code to make WEG work with 10.16 is what caused this issues, will try to see which commit causes that.

For me the bad commit is acidanthera/WhateverGreen@6a1990e

@vit9696
Copy link
Contributor

vit9696 commented Aug 13, 2020

@Mateo1234454545 if this is the case, then igfxnorpsc=1 should definitely resolve the problem. The only reason why it would not is if you fail to add the argument. Make sure that you add it via OpenCore config.plist and check that you did not forget to add boot-args to the Delete section.

Note, that you could always check the argument presence by running nvram boot-args command.

@Mateo1234454545
Copy link

I did , but didn't do anything.

To be more precise , I builded the kext including the commit : acidanthera/WhateverGreen@fee20a9 , because I wanted to run on Big Sur.
So any later commit could be the bad one.
It is difficult for me to find out which one.

@07151129
Copy link

This issue is about GuC PM, not host scheduler. Refrain from posting here unless it's about GuC.

@zombillano
Copy link

zombillano commented Aug 14, 2020

Ok, last one. I can confirm that acidanthera/WhateverGreen@6a1990e is the bad commit.

then igfxnorpsc=1 should definitely resolve the problem.

This kinda solves the problem. It perform worst in terms of thermals and power efficency. Now it doesn't get stuck at 1GHz but at 300 Mhz, although it gets back to 0 after a few minutes. Not an ideal solution but at least I think we are getting close.

This issue is about GuC PM, not host scheduler. Refrain from posting here unless it's about GuC.

Right, I won't post anymore over here. Can I ask you a favor? Is it possible for you to open an issue dedicated to this problem? I'd do it by myself but I think you will make a better job at giving a proper title and description. Thanks in advance!

@sanoj-m
Copy link

sanoj-m commented Aug 14, 2021

i got the 1.2GHz stuch fixed by force loading GuC using igfxfw=2 boot arg

@Ubsefor
Copy link

Ubsefor commented Sep 15, 2021

As another workaround, you may try to use HibernationFixup kext to disable IGPU state restoration after sleep, at least it seemed to help me, as I cannot load Apple GuC on my machine.

@Mateo1234454545
Copy link

As another workaround, you may try to use HibernationFixup kext to disable IGPU state restoration after sleep, at least it seemed to help me, as I cannot load Apple GuC on my machine.

And if you use this kext what value should we enter at "Opencore's Hibernate mode" ?

@Ubsefor
Copy link

Ubsefor commented Sep 15, 2021

As another workaround, you may try to use HibernationFixup kext to disable IGPU state restoration after sleep, at least it seemed to help me, as I cannot load Apple GuC on my machine.

And if you use this kext what value should we enter at "Opencore's Hibernate mode" ?

There’s Auto string, which, according to Configuration.pdf detects whether native RTC/NVRAM (or both) hibernation is possible.

@Wilber666
Copy link

10th intel igpu has this problem too.(i5.10500h)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed project:green
Development

No branches or pull requests