Jump to content

[GUIDE] Edit AppleGraphicsPowerManagement.kext to unleash nvidia's GTX 570/580 full power and save energy at the same time.


  • Please log in to reply
67 replies to this topic

#61
JaE-V

JaE-V

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 933 posts
  • Gender:Male
  • Location:Texas

thanks for this, will test on my 560ti tonight



#62
Lyle M

Lyle M

    InsanelyMac Protégé

  • Donators
  • 54 posts
  • Gender:Male
  • Location:Maryland, USA

How and why to edit thresholds for AppleGraphicsPowerManagement.kext (AGPM)


I based my research on the GTX 570 but the basics should be valid to any other nvidia card, e.g. Fermi based: 460/470/480/550/560 too.

First of all the bad news. I couldn't get Lion as smooth as I had hoped for. I still think my previous Ati 5770 was better in that regards. Although in Novabench it only reaches ~800fps whereas the GTX 570 easily hits more than 2500fps!! Oh, don't get me started on cinebench. I get about 37fps with the Ati 5770 and only 30fps with the GTX 570 with both modes above.

First, a big thanks for this posting. I was getting lots of windowserver crashes prior to editing the AGPM kext.

 

After my first edits, I was getting similar Cinebench results (35) to those quoted above on my GTX 560 ti on 10.9 using the conservative setting in the first post. I later changed Info.plist in the AGPM kext as follows:

                                <key>MacPro5,1</key>
                                <dict>
                                        <key>Vendor10deDevice1200</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>25</integer>
                                                                <integer>75</integer>
                                                                <integer>90</integer>
                                                                <integer>100</integer>
                                                        </array>
                                                        <key>Threshold_Low</key>
                                                        <array>
                                                                <integer>0</integer>
                                                                <integer>0</integer>
                                                                <integer>94</integer>
                                                                <integer>98</integer>
                                                        </array>
                                                </dict>
                                                <key>LogControl</key>
                                                <integer>1</integer>
                                                <key>control-id</key>
                                                <integer>18</integer>
                                        </dict>

I'm no ace at this by any stretch. My goal is to get to the higher power states faster and at lower levels, and remain there longer. I imagine there's still some refinement needed.

 

I monitored my GPU core frequency with HWMonitor while I was benchmarking. When seeing the lower than expected scores, my GPU was typically at 405MHz. With the above settings, my benchmarks improved dramatically and my GPU mostly remained at 822MHz while testing. When the benchmark finished, my GPU core dropped to 50MHz.

 

My Cinebench results improved as follows:

 

Attached File  560ti_cbR15.png   91.29KB   9 downloads

 

My Novabench score hits 1121. Certainly no GTX 570!

 

My Heaven benchmark improved significantly. However, I noted that every 6 seconds the video would stutter. The graph of my CPU Core speed showed a corresponding frequency drop. I'm guessing that I'll need to further adjust the Threshold_Low figures. However, I'm wondering if adjusting the intervals or sample rates might help. I'd be grateful for any feedback.

 

Attached File  560ti_heaven.png   86.14KB   6 downloads

 

I think my logs convey this stutter (note the 6 second interval): 

11/5/13 3:03:40.000 PM kernel[0]: AGPM: updateGPUHwPstate(1, 0): fHwPstate = 0 fFB = 0xffffff8020acc800
11/5/13 3:03:40.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 1. Calling fFB->setAggressiveness()...
11/5/13 3:03:40.000 PM kernel[0]: AGPM: GPU = display G-state set to 1 from 0, ControlID = 18. SW occupancy updated.
11/5/13 3:03:41.000 PM kernel[0]: AGPM: updateGPUHwPstate(0, 0): fHwPstate = 1 fFB = 0xffffff8020acc800
11/5/13 3:03:41.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 0. Calling fFB->setAggressiveness()...
11/5/13 3:03:41.000 PM kernel[0]: AGPM: GPU = display G-state set to 0 from 1, ControlID = 18. SW occupancy updated.
11/5/13 3:03:47.000 PM kernel[0]: AGPM: updateGPUHwPstate(1, 0): fHwPstate = 0 fFB = 0xffffff8020acc800
11/5/13 3:03:47.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 1. Calling fFB->setAggressiveness()...
11/5/13 3:03:47.000 PM kernel[0]: AGPM: GPU = display G-state set to 1 from 0, ControlID = 18. SW occupancy updated.
11/5/13 3:03:48.000 PM kernel[0]: AGPM: updateGPUHwPstate(0, 0): fHwPstate = 1 fFB = 0xffffff8020acc800
11/5/13 3:03:48.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 0. Calling fFB->setAggressiveness()...
11/5/13 3:03:48.000 PM kernel[0]: AGPM: GPU = display G-state set to 0 from 1, ControlID = 18. SW occupancy updated.
11/5/13 3:03:54.000 PM kernel[0]: AGPM: updateGPUHwPstate(1, 0): fHwPstate = 0 fFB = 0xffffff8020acc800
11/5/13 3:03:54.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 1. Calling fFB->setAggressiveness()...
11/5/13 3:03:54.000 PM kernel[0]: AGPM: GPU = display G-state set to 1 from 0, ControlID = 18. SW occupancy updated.
11/5/13 3:03:55.000 PM kernel[0]: AGPM: updateGPUHwPstate(0, 0): fHwPstate = 1 fFB = 0xffffff8020acc800
11/5/13 3:03:55.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 0. Calling fFB->setAggressiveness()...
11/5/13 3:03:55.000 PM kernel[0]: AGPM: GPU = display G-state set to 0 from 1, ControlID = 18. SW occupancy updated.
11/5/13 3:04:01.000 PM kernel[0]: AGPM: updateGPUHwPstate(1, 0): fHwPstate = 0 fFB = 0xffffff8020acc800
11/5/13 3:04:01.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 1. Calling fFB->setAggressiveness()...
11/5/13 3:04:01.000 PM kernel[0]: AGPM: GPU = display G-state set to 1 from 0, ControlID = 18. SW occupancy updated.
11/5/13 3:04:02.000 PM kernel[0]: AGPM: updateGPUHwPstate(0, 0): fHwPstate = 1 fFB = 0xffffff8020acc800
11/5/13 3:04:02.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 0. Calling fFB->setAggressiveness()...
11/5/13 3:04:02.000 PM kernel[0]: AGPM: GPU = display G-state set to 0 from 1, ControlID = 18. SW occupancy updated.
11/5/13 3:04:08.000 PM kernel[0]: AGPM: updateGPUHwPstate(1, 0): fHwPstate = 0 fFB = 0xffffff8020acc800
11/5/13 3:04:08.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 1. Calling fFB->setAggressiveness()...
11/5/13 3:04:08.000 PM kernel[0]: AGPM: GPU = display G-state set to 1 from 0, ControlID = 18. SW occupancy updated.
11/5/13 3:04:14.000 PM kernel[0]: AGPM: updateGPUHwPstate(2, 0): fHwPstate = 1 fFB = 0xffffff8020acc800
11/5/13 3:04:14.000 PM kernel[0]: AGPM: updateGPUHwPstate(): state = 2. Calling fFB->setAggressiveness()...
11/5/13 3:04:14.000 PM kernel[0]: AGPM: GPU = display G-state set to 2 from 1, ControlID = 18. SW occupancy updated.


#63
Lyle M

Lyle M

    InsanelyMac Protégé

  • Donators
  • 54 posts
  • Gender:Male
  • Location:Maryland, USA

I made the following change:

<key>Threshold_Low</key>
<array>
        <integer>0</integer>
        <integer>97</integer>
        <integer>97</integer>
        <integer>98</integer>
</array>

My Cinebench R15 score when up to 93. The stuttering in Heaven is gone.

 

While typing this, my GPU core reads 50MHz, but after I navigate some web sites, the core goes to 405MHz and sticks there for quite a while. I may try 0,95,95,97 next.

 

UPDATE: 0,95,95,97: GPU core doesn't idle at 405MHz for near as long. Cinebench score hovering around 90. No stuttering in Heaven. I think I'll keep these settings for a while.



#64
existation

existation

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts

Hi. Thank you for your research.

After editing I got this in my log. Is this normal?

[AGPM Controller] build GPUDict by Vendor10deDevice1081
AGPM: GPU = PEGP Initialized, Control ID 18
EDID CEA Extensions not valid for audio [Revision ID]: 1 (minimum value: 3)
ACPI_SMC_GPU_CtrlLoop: NOTE: ignoring mismatched primary control with ID:18


#65
Regi Yassin

Regi Yassin

    Who am I ?

  • Members
  • PipPipPipPipPip
  • 278 posts
  • Gender:Not Telling

 

Hi. Thank you for your research.

After editing I got this in my log. Is this normal?

[AGPM Controller] build GPUDict by Vendor10deDevice1081
AGPM: GPU = PEGP Initialized, Control ID 18
EDID CEA Extensions not valid for audio [Revision ID]: 1 (minimum value: 3)
ACPI_SMC_GPU_CtrlLoop: NOTE: ignoring mismatched primary control with ID:18

try change the control id to 17



#66
existation

existation

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts

Hmm... I changed to 17 and now i got clear log. What a difference?



#67
Paul__24

Paul__24

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts

Hello and thanks for providing all this invaluable information. Unfortunately i can't wrap my brain around it.

 

I have the GT330M in my MacBook Pro and would like to achieve this:

Switch only between state 3 (low) and 2 (medium), leaving state 1 (high) completely out.

 

Why? I'd like to prolong the life time of my second logic board (yeah, recently replaced).

I might miss out on a lot of performance, but that performance would be still way better than what the internal intel chip provides.

 

This is the part of the plist for my GT330M. If anyone could tell me which parts i would have to change and how to achieve my goal, i would be very grateful.

<key>MacBookPro6,2</key>
				<dict>
					<key>LogControl</key>
					<integer>0</integer>
					<key>Vendor8086Device0046</key>
					<dict>
						<key>BoostPState</key>
						<array>
							<integer>0</integer>
							<integer>1</integer>
							<integer>2</integer>
							<integer>3</integer>
						</array>
						<key>BoostTime</key>
						<array>
							<integer>3</integer>
							<integer>3</integer>
							<integer>3</integer>
							<integer>3</integer>
						</array>
						<key>Heuristic</key>
						<dict>
							<key>BusyDownThresholdPercent</key>
							<integer>65</integer>
							<key>BusyUpThresholdPercent</key>
							<integer>80</integer>
							<key>DiagnosticModeDefault</key>
							<integer>0</integer>
							<key>EvaluateDownInterval</key>
							<integer>350000</integer>
							<key>EvaluateUpInterval</key>
							<integer>66000</integer>
							<key>ID</key>
							<integer>2</integer>
							<key>SensorOption</key>
							<integer>1</integer>
						</dict>
						<key>HeuristicOld</key>
						<dict>
							<key>ID</key>
							<integer>1</integer>
							<key>IdleInterval</key>
							<integer>100</integer>
							<key>SensorOption</key>
							<integer>1</integer>
							<key>Threshold_High</key>
							<array>
								<integer>50</integer>
								<integer>75</integer>
								<integer>96</integer>
								<integer>100</integer>
							</array>
							<key>Threshold_High_v</key>
							<array>
								<integer>70</integer>
								<integer>85</integer>
								<integer>94</integer>
								<integer>100</integer>
							</array>
							<key>Threshold_Low</key>
							<array>
								<integer>0</integer>
								<integer>40</integer>
								<integer>55</integer>
								<integer>92</integer>
							</array>
							<key>Threshold_Low_v</key>
							<array>
								<integer>0</integer>
								<integer>50</integer>
								<integer>60</integer>
								<integer>92</integer>
							</array>
						</dict>
						<key>control-id</key>
						<integer>16</integer>
						<key>max-power-state</key>
						<integer>15</integer>
						<key>min-power-state</key>
						<integer>0</integer>
					</dict>
				</dict>

Here at the end is a "max-power-state". Would it maybe be enough to just lower the number? Is this an indicator for how much the GPU can ramp up?



#68
RobertX

RobertX

    InSanelyMac Maverick

  • Members
  • PipPipPipPipPipPipPip
  • 531 posts
  • Gender:Not Telling

Hello and thanks for providing all this invaluable information. Unfortunately i can't wrap my brain around it.

 

I have the GT330M in my MacBook Pro and would like to achieve this:

Switch only between state 3 (low) and 2 (medium), leaving state 1 (high) completely out.

 

Why? I'd like to prolong the life time of my second logic board (yeah, recently replaced).

I might miss out on a lot of performance, but that performance would be still way better than what the internal intel chip provides.

 

This is the part of the plist for my GT330M. If anyone could tell me which parts i would have to change and how to achieve my goal, i would be very grateful.

<key>MacBookPro6,2</key>
				<dict>
					<key>LogControl</key>
					<integer>0</integer>
					<key>Vendor8086Device0046</key>
					<dict>
			

Here at the end is a "max-power-state". Would it maybe be enough to just lower the number? Is this an indicator for how much the GPU can ramp up?

...hmm, you write of GT330m...but the example you show from AGPM is clearly for GMA 5700MHD...this will not end well... :smoke: ...your device is nvidia so,...

 

 

...you might want to start here.. i think you have this model: MacBookPro 2010...  from plist of AGPM ..

 

<key>MacBookPro7,1</key>
                <dict>
                    <key>IGPU</key>
                    <dict>
                        <key>BoostPState</key>
                        <array>
                            <integer>0</integer>
                            <integer>1</integer>
                            <integer>2</integer>
                            <integer>3</integer>
                        </array>
                        <key>BoostTime</key>
                        <array>
                            <integer>3</integer>
                            <integer>3</integer>
                            <integer>3</integer>
                            <integer>3</integer>
                        </array>
                        <key>Heuristic</key>
                        <dict>
                            <key>ID</key>
                            <integer>1</integer>
                            <key>IdleInterval</key>
                            <integer>100</integer>
                            <key>SensorOption</key>
                            <integer>1</integer>
                            <key>Threshold_High</key>
                            <array>
                                <integer>96</integer>
                                <integer>96</integer>
                                <integer>96</integer>
                                <integer>100</integer>
                            </array>
                            <key>Threshold_High_v</key>
                            <array>
                                <integer>70</integer>
                                <integer>85</integer>
                                <integer>94</integer>
                                <integer>100</integer>
                            </array>
                            <key>Threshold_Low</key>
                            <array>
                                <integer>0</integer>
                                <integer>88</integer>
                                <integer>88</integer>
                                <integer>92</integer>
                            </array>
                            <key>Threshold_Low_v</key>
                            <array>
                                <integer>0</integer>
                                <integer>50</integer>
                                <integer>60</integer>
                                <integer>92</integer>
                            </array>
                        </dict>
                        <key>QSC</key>
                        <dict>
                            <key>Enabled</key>
                            <integer>1</integer>
                            <key>Mode</key>
                            <integer>0</integer>
                            <key>PStateOffTime</key>
                            <array>
                                <integer>0</integer>
                                <integer>11200</integer>
                                <integer>9000</integer>
                                <integer>0</integer>
                            </array>
                            <key>PStateOnTime</key>
                            <array>
                                <integer>0</integer>
                                <integer>4800</integer>
                                <integer>7000</integer>
                                <integer>0</integer>
                            </array>
                        </dict>
                        <key>control-id</key>
                        <integer>16</integer>
                    </dict>
                    <key>LogControl</key>
                    <integer>0</integer>
                </dict>
 







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy