#1
Posted 05 April 2011 - 12:30 AM
Using stock AppleGraphicsPowerManagement.kext video is very laggy.
Without AGPM video is smooth, but as expected, the laptop runs hot all the time, even idling.
If I add the card's ID (0x0df0) in AGPM, it works fine, with low temps idling and good performance in games.
In AGPM I see some cards have values for Threshold_High and Threshold_Low, while others also have Threshold_High_v and Threshold_Low_v.
For my card, if I add the "_v" thresholds I have mouse lags at certain moments, like when FireFox is rendering a page. Also when an animation is run for the first time (like clicking the applications folder in dock) it's laggy, but if it's run again, next times it's smooth.
I'm running 10.6.7 with latest Fermi drivers (256.01.00f03v7 from 2011.03.22).
Does anyone know/guess what are those "_v" thresholds, or have any information about what values are recommended for each card?
Thanks.
#2
Posted 05 April 2011 - 05:21 PM
Attached is the legacy that gives the best result until now (GeForce GT 425M). The values used in Threshold_High and Threshold_Low are the same used in Threshold_High_v and Threshold_Low_v for the GT 330M (0x0a29) in MacBookPro6,2.
Looks like it needs low values in BoostPState 1 and 2, and high values only in 3 and 4. A high value in second BoostPState causes the lag.
LegacyAGPM.kext.zip 2.6KB
35 downloads
#3
Posted 05 April 2011 - 07:51 PM
Stell
#4
Posted 06 April 2011 - 06:07 PM
Some tests:
Stock 10.6.7 AGPM
stock_agpm.png 102.03KB
537 downloadsNo AGPM
no_agpm.png 96.28KB
492 downloadsLegacy from post #2
legacy_1.png 95.55KB
323 downloadsLegacy from this post
legacy_2.png 102.79KB
259 downloads
LegacyAGPM.kext.zip 2.61KB
12 downloads
#5
Posted 06 April 2011 - 06:40 PM
<key>MacPro5,1</key>
<dict>
<key>Vendor10deDevice05e2</key> /*/ changed to Device06cd /*/
<key>Heuristic</key>
<dict>
<key>ID</key>
<integer>0</integer>
<key>IdleInterval</key>
<integer>250</integer>
<key>SensorOption</key>
<integer>1</integer>
<key>SensorSampleRate</key>
<integer>4</integer>
<key>TargetCount</key>
<integer>5</integer>
<key>Threshold_High</key>
<array>
<integer>87</integer>
<integer>87</integer>
<integer>87</integer>
<integer>100</integer>
</array>
<key>Threshold_Low</key>
<array>
<integer>0</integer>
<integer>87</integer>
<integer>87</integer>
<integer>87</integer>
</array>
</dict>
<key>LogControl</key>
<integer>0</integer>
<key>control-id</key>
<integer>18</integer>
</dict>
<key>Vendor10deDevice0640</key>
<dict>
<key>Heuristic</key>
<dict>
<key>ID</key>
<integer>0</integer>
<key>IdleInterval</key>
<integer>250</integer>
<key>SensorOption</key>
<integer>1</integer>
<key>SensorSampleRate</key>
<integer>4</integer>
<key>TargetCount</key>
<integer>5</integer>
<key>Threshold_High</key>
<array>
<integer>93</integer>
<integer>93</integer>
<integer>93</integer>
<integer>100</integer>
</array>
<key>Threshold_Low</key>
<array>
<integer>0</integer>
<integer>97</integer>
<integer>97</integer>
<integer>97</integer>
</array>
</dict>
<key>LogControl</key>
<integer>0</integer>
<key>control-id</key>
<integer>18</integer>
</dict>
<key>default-control-id</key>
<integer>18</integer>
</dict>
There are 2 devices. I chose the first one to replace. Both have slightly different thresholds. Are these values available to us in another way? Meaning can I figure out the threshold of my card and change these values to match? Or will replacing one of these devices be the best solution.
Thanks
#6
Posted 07 April 2011 - 07:43 PM
The lowest reading in my card was 50.6 MHz (9%) and the highest was 560.8 MHz (100%).
min.PNG 25.56KB
181 downloads
max.PNG 25.59KB
172 downloadsThe problem is that AGPM has 4 BoostPStates in Threshold_High and other 4 in Threshold_Low, and in some models there are also Threshold_High_v and Threshold_Low_v which I have no idea what they are for.
There's also this RivaTuner app that may help, but I didn't try it yet.
el coniglio wrote a parser for AGPM Info.plist which may help. Desktop cards look an easier task as they have only 2 threshold profiles with 2 values each
imac9_1_1.png 25.33KB
168 downloadswhile laptop ones have more values and more profiles
macbookpro6_2.png 38.69KB
110 downloadsAll graphs
AGPM.zip 1005.55KB
93 downloads
#7
Posted 08 April 2011 - 02:44 AM
I posted a year ago at MR that I thought it awfully odd that of the two Nvidia devices listed, one was 0640, the GT120 (9500GT to you & me) and the other is 05e2...which is the Nvidia GTX260, a card which Apple never included in their machines.
If the kext actually needed to have correct device id's in it to work, why hasn't anyone with a 4,1 or 5,1 ever noticed that their GTX285 was always running at Power State 1? Wouldn't Apple have fixed that long ago? I think there is a part of this next that we aren't viewing where actual card ids are listed. Why is it that Quadro 4000 works fine but ISN'T listed either?
I have found that usually just chucking the thing out of the Ext folder makes my cards run fine. As in, I can see the OGL Ext Viewer scores JUMP from 100's to 1000's as the card jumps power states to 3D. I have also noted that an Nvidia 8800GT will run WORSE once I have done this, and it doesn't seem to be listed.
So, as a post above shows that highest speeds occurred when the kext was just GONE...can anyone show that a particular card worked BETTER using this kext (vs. tossing it out)?
Has anyone dug deeper inside to see how it actually works?
My guess is that the fact that the only GT200 card listed is a GTX260 shows that when they were writing drivers for GTX285 they did it with a GTX260 and this value we see in AGPM is a left over stub, something not necessarily used anymore.
#8
Posted 08 April 2011 - 02:58 AM
The problem in my case is that it's a laptop, and without AGPM the battery lasts half the time when I'm not using full 3D acceleration, so removing the kext is not an option.So, as a post above shows that highest speeds occurred when the kext was just GONE...can anyone show that a particular card worked BETTER using this kext (vs. tossing it out)?
I'm not saying AGPM will give higher speeds. It's about power management.
#9
Posted 08 April 2011 - 11:03 AM
I was just doing a search for the threshold_high variable because I was hoping some clever person already figured this stuff out
So far what I've learned is that, legacyagpm kext removed, my core clock was no longer throttled and applications run very smoothly, opengl extensions, velociraptor game, and minecraft. After entering my own device id into the oem apple kext, the throttling begins. I learned that having a "LogControl" entry set to 1 will provide you a verbose print out to the kernel.log any time your IGPU, integrated gpu, changes power savings states.
0 = no throttling, 1 = some throttling, 2 = decent throttling, 3 = most conservative mode.
I have the 9400M chipset in here, so I've been pluggin in different Heuristics from model that should have similar hardware, Macbook 5,3 Macmini 3,1. As I experimented around with these things, I also noticed that throttling wouldn't work until I gave it the SensorOption 1. The Legacyagpm kext which I tossed had that sensoroption 1 in there, along with SensorSampleRate 4, and TargetCount 5. I left those last variables out to find out that, my gpu works even without them. And from looking at other oem mac configs, I see thats not uncommon for some mac's heuristics to leave those options out.
It's my belief that the V stands for volts in this "Threshold_Low_v" and that "Threshold_Low" would be related to Mhz. It would only make sense, that if you change the core clock value, to change the volts to be as power efficient as possible.
Now what the "number" value represents is what I'm trying to understand now, and presumably you are also.
So each Power State is represented by 0, 1,2,3. Each state has a High and a corresponding Low value.
Here's a visual diagram

By the definition of it, these Heuristics, are just a best guess, but they do represent a logical component, I was thinking maybe such as % GPU Idle.
Update
I did some testing to see if my theory would hold and it does so far. I got a video clip from youtube, downloaded it, and opened up the OpenGL Driver Monitor found in the dev tools. I setup a parameter for GPU core utilization, set the option to Linear, Min zero 0, Max 1G. When I play the video the GPU usage peaks just under 20% and falls back down to just a bit over 10% average while playing. Prior to modifications, my thresholds were as above on the Macbook 5,2 example. So when the video starts, and gets going, my PState is at 2 because utiltization is above the 3rd Pstate's threshold at aboutg 15% or so, so Pstate 2 is engaged.
So with that, I went in and made a modification to Pstate 3 low to 75, and moved Pstate 2's High out of it's range to 74. After a touch of the file system and a reboot, my Pstate is at 3 while playing the same video.
After quickly glancing at your earlier posts and applying that IDLE GPU % utilization logic, it makes sense. If your processor is 100% idle, then it doesn't need an overclock nor extra voltage. The opposite is true for low numbers. It's an overclock/underclock power savings mechanism.
- Marten likes this
#10
Posted 08 April 2011 - 07:29 PM
thanks for the explanation, it makes perfect sense.
I was wrong again in post #2, the mouse lag happens when it switches between G-states 3 and 2
Apr 8 16:05:41 MacBook-de-Cassio kernel[0]: AGPM: GPU = GFX0 G-state set to 2 from 3, ControlID = 17
Apr 8 16:05:44 MacBook-de-Cassio kernel[0]: AGPM: GPU = GFX0 G-state set to 3 from 2, ControlID = 17
When I set G-state 3 with low=99 ang high=100 it's never used, so no mouse lag.
Now I'm trying to figure out if I should increase the interval for G-state 3 as you did, leave it in 2 as minimum (which gives smooth desktop animations) or if it's better not using AGPM at all (looks like using latest Fermi drivers it stays in G-state 3 while in desktop, because animations are laggy, like when clicking the applications folder in dock).
#11
Posted 08 April 2011 - 09:25 PM
Unfortunately it's not true. It seems to start in G-state 3, but once it goes to higher states it never goes back to 3. I can tell because desktop animations stay smooth and the laptop gets much hotter.looks like using latest Fermi drivers it stays in G-state 3 while in desktop, because animations are laggy, like when clicking the applications folder in dock
The best setup for me (so far) is with AGPM but never using G-state 3 (to avoid mouse lag).
Test results
opengl_test.png 102.97KB
152 downloadsState changes during test
Apr 8 18:29:18 MacBook-de-Cassio kernel[0]: AGPM: GPU = GFX0 G-state set to 1 from 2, ControlID = 17
Apr 8 18:29:19 MacBook-de-Cassio kernel[0]: AGPM: GPU = GFX0 G-state set to 0 from 1, ControlID = 17
Apr 8 18:30:30 MacBook-de-Cassio kernel[0]: AGPM: GPU = GFX0 G-state set to 1 from 0, ControlID = 17
Apr 8 18:30:32 MacBook-de-Cassio kernel[0]: AGPM: GPU = GFX0 G-state set to 2 from 1, ControlID = 17
#12
Posted 09 April 2011 - 05:40 PM
LegacyAGPM.kext.zip 2.6KB
146 downloadsI tried "fixing" the intervals as below, but it only causes more unnecessary state changes (like switching between states 0-2 more times when playing a game)
<key>Threshold_High</key> <array> <integer>59</integer> <integer>79</integer> <integer>99</integer> <integer>100</integer> </array> <key>Threshold_Low</key> <array> <integer>0</integer> <integer>60</integer> <integer>80</integer> <integer>100</integer> </array>
#13
Posted 09 April 2011 - 10:08 PM
I'm curious how things would work for your card on a windows 7 install, for example doing windows aero stuff like the 3d alt tabbin stuff, check and see how it performs, check which state it runs in and such to get an idea of how things work there, might be useful here.
I'm about to load windows xp or 7 on here to get a better understanding or how things work on here. I'll do my best to not hose this near perfect os.
#14
Posted 14 April 2011 - 06:26 PM
i tried to start a AGPM thread on projectosx a while ago, without any response, so i am interested in what comes out here.
masterchief has done some experiments with it a while ago.
but there is on projectosx a nvidia clock darwin port thread
http://www.projectos...?showtopic=1246
which gives a little insight about the temp and fanspeed of the GPU
#15
Posted 14 April 2011 - 06:35 PM
For example, here's my GTX 460, running at roughly minus two million MHz:
Gringos-MacPro:nvclock0.8b5_7-bin-universal Gringo$ sudo ./nvclock -f -i -- General info -- Card: Unknown Nvidia card Architecture: GC4 A1 PCI id: 0x0000 Subvendor id: 0x0000 GPU clock: -2147483.750 MHz Bustype: PCI -- Memory info -- Amount: 0 MB Type: 128 bit SDR Clock: -2147483.750 MHz
#16
Posted 14 April 2011 - 07:04 PM
Unable to shadow the video bios -- General info -- Card: Unknown Nvidia card Architecture: GC1 A1 PCI id: 0x0000 Subvendor id: 0x0000 GPU clock: -2147483.750 MHz Bustype: PCI -- Memory info -- Amount: 0 MB Type: 128 bit SDR Clock: -2147483.750 MHz
camoguy, sorry for late reply, I only tested it today.
#17
Posted 29 June 2011 - 03:50 AM
But now I noticed something strange, when it's in the lowest g-state, if I scroll a page in FireFox (using trackpad or mouse wheel) I hear some crackles in the laptop speakers. When it engages the second g-state there's no noise. Have someone experienced something like this?
#18
Posted 29 June 2011 - 10:19 AM
I just wanted to thank you for explaining AGPM kext in detail.
I also own Fermi card (460) but I've lost my temper due freezes and bought Mac Mini 2010. Only to find out that Mac Mini also suffers from AGPM throttling lag, especially in expose, interface animations etc. Worst thing is that 320M, which is integrated in my Mini, has same issues across all Mac hardware, Macbook Air, Pro etc. Although, there are some Macbooks with this GPU which don't have any lag :S
Hopefully, for a weekend project, I'll come up with perfect AGPM mode for my Mac Mini. Currently, I've deleted it and appleupstreamclient.kext as well, to get somewhat normal animations.
It really sucks that Apple allowed such a thing to happen.
Thanks!
#19
Posted 09 July 2011 - 07:59 AM
-- VideoBios information -- Version: 62.92.52.00.09 Signon message: GeForce 9800 GT VGA BIOS Performance level 0: gpu 450MHz/shader 1200MHz/memory 700MHz/0.00V/100% Performance level 1: gpu 600MHz/shader 1500MHz/memory 900MHz/0.00V/100% VID mask: 3 Voltage level 0: 0.95V, VID: 0 Voltage level 1: 1.00V, VID: 1 Voltage level 2: 1.05V, VID: 2 Voltage level 3: 1.10V, VID: 3
I copied the the 10de 640 renamed it to 605. What what values are in the driver?
Voltage , clock speed?
<key>Vendor10deDevice0605</key> <dict> <key>Heuristic</key> <dict> <key>ID</key> <integer>0</integer> <key>IdleInterval</key> <integer>250</integer> <key>SensorOption</key> <integer>1</integer> <key>SensorSampleRate</key> <integer>4</integer> <key>TargetCount</key> <integer>5</integer> <key>Threshold_High</key> <array> <integer>93</integer> <integer>93</integer> <integer>93</integer> <integer>100</integer> </array> <key>Threshold_Low</key> <array> <integer>0</integer> <integer>97</integer> <integer>97</integer> <integer>97</integer> </array> </dict> <key>LogControl</key> <integer>1</integer> <key>control-id</key> <integer>18</integer> </dict> </dict>According to Kernel log the GPU States are changing.
#20
Posted 20 August 2011 - 04:52 PM
Thanks for starting this thread! It helped me a lot!
@camoguy
Thanks so much, for your research on AGPM's thresholds. Your posting let me tweak the GTX 570 to save energy up to 50W during low GPU load.
I wrote a guide how and why to edit the thresholds here:
[GUIDE] Edit AppleGraphicsPowerManagement.kext to unleash nvidia's GTX 570/580 full power and save energy at the same time.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users



Sign In
Create Account








