Archive for December 13, 2016

Tuesday, December 13, 2016

The Discrete GPU and You

Chris Liscio:

The combination of a dGPU and lower-capacity battery means that the practical battery life of these machines gets cut in half (or worse) when the dGPU is active. I’m not sure that previous models had nearly as bad a “battery life delta” as these ones, but boy-howdy is it noticeable in practice on this system.


This whole problem can be very easy to solve. You just have to set NSSupportsAutomaticGraphicsSwitching key to YES in your application’s Info.plist. The trouble is that an OpenGL context is being created, which defaults to switching the dGPU on. Enabling this flag in the plist will very likely fix the problem on its own, as the frameworks should Do the Right Thing (more details below) if they need access to OpenGL.


To solve the bug I had, it turned out that I was making a call to -[NSOpenGLContext clearDrawable] in the dealloc method of my custom NSOpenGLView. My NSOpenGLContext was already destructed, and a whole new NSOpenGLPixelFormat was getting created and kicked the GPU on again. The call I should have used instead was -[NSOpenGLView clearGLContext] (though I don’t even know if that’s really required, to be honest.

Previously: macOS 10.12.2 Removes Battery Time Remaining Estimate, gfxCardStatus.

Update (2016-12-13): McCloud:

you can explicitly ask CoreGL not to turn on the discrete GPU

You need to create your context with kCGLPFASupportsAutomaticGraphicsSwitching - won’t trigger discrete transition.

Uber Whistleblower on Location Privacy

Will Evans (via Christopher Soghoian, Hacker News):

“Uber’s lack of security regarding its customer data was resulting in Uber employees being able to track high profile politicians, celebrities, and even personal acquaintances of Uber employees, including ex-boyfriends/girlfriends, and ex-spouses,” Spangenberg wrote in a court declaration, signed in October under penalty of perjury.

After news broke two years ago that executives were using the company’s “God View” feature to track customers in real time without their permission, Uber insisted it had strict policies that prohibited employees from accessing users’ trip information with limited exceptions.

But five former Uber security professionals told Reveal from The Center for Investigative Reporting that the company continued to allow broad access even after those assurances.


In addition to the security vulnerabilities, Spangenberg said Uber deleted files it was legally obligated to keep. And during government raids of foreign Uber offices, he said the company remotely encrypted its computers to prevent authorities from gathering information.

Nick Heer:

In separate news, Uber recently updated their privacy policy to allow tracking users’ location data for up to five minutes after exiting the vehicle.

Oluseyi Sonaiya:

Let’s not forget that Google exposed people’s private information on the basis of an automatic social graph constructed from their email.

All of which is to say that while Uber’s privacy violations are symptomatic of organizational failure, all information caches are vulnerable.

Update (2016-12-15): Anita Balakrishnan (via Slashdot):

It’s absolutely untrue that ‘all’ or ‘nearly all’ employees have access to customer data, with or without approval,” Uber said. “We have built [an] entire system to implement technical and administrative controls to limit access to customer data to employees who require it to perform their jobs. This could include multiple steps of approval—by managers and the legal team—to ensure there is a legitimate business case for providing access.”

Update (2016-12-20): John Gruber:

I don’t trust Uber. But we can collectively verify that in this case, they’re doing exactly what they say they’re doing.

Update (2016-12-22): John Gruber:

Daring Fireball readers on Twitter started sending me screenshots of their Location Services settings, showing that the Uber app is still checking for their location days or even weeks after they last used the app.

Update (2016-12-27): John Gruber:

I think this might explain it. I’m thinking Apple should change this so that these extensions only load when you tap the “Ride” tab in Maps. As it stands now, they load (and check your location) every time you enter the Maps app, period.

macOS 10.12.2 Removes Battery Time Remaining Estimate

Jim Dalrymple (MacRumors, Hacker News, 9to5Mac, Slashdot):

Some users have reported problems with battery life, but Apple told me that after a lot of testing they stand behind the 10 hour battery life with the new MacBook Pro.

However, to help users better determine the battery life, Apple has removed the “time remaining” indicator from the battery icon in the menu bar with the latest update. You can still see the image on the top of the screen, and you can see the percentage, but you will no longer be able to see how much time is remaining before your battery dies.

The reason for removing it is very simple: it wasn’t accurate.

John Gruber:

This is like being late for work and fixing it by breaking your watch.

Benjamin Mayo:

My personal experience is that this estimate was always widely inaccurate on every MacBook I’ve owned. It would change erratically and jump from seven hours to three hours on a whim, based on whatever intensive task was just opened. Its removal doesn’t come as a hindrance, therefore, because I was never really basing my computer usage around what that readout said. Some Windows manufacturers have already removed battery time estimates from their PC laptops.

The new update makes the Mac mirror how iOS has always worked[…]

I tend to think that an inaccurate (but constantly updating) estimate is better than none. Otherwise, people will have to make their own estimates, which takes attention and is likely to be even less accurate. I never liked how the estimate claimed to be accurate down to the minute. I would like to see an estimate with fewer significant digits, both to hide the erratic changes and to avoid over-representing the accuracy.

Secondly, would this have even become an issue if Apple hadn’t made the new MacBook Pro’s battery smaller? This smells like a software bandaid for a hardware problem, like when they responded to antenna problems by making the iPhone signal strength bars taller.

Update (2016-12-13): Marco Arment:

My 15-inch 2016 MacBook Pro with Touch Bar is pretty good in most ways, but it’s a noticeable regression in battery life from the previous generation. Apple claims it lasts 10 hours, but I’ve never gotten that — in a fairly light web-productivity workload, I average around 5–7 hours, and if I’m using Xcode, I’m lucky to get 4–5 hours.


Having used Apple laptops for over a decade, I’ve always found the time-remaining estimate to also be a good indicator of how much power I’m burning with my current activities so I can “budget” my battery usage when I’m going to need it.


A percentage only tells you the current state, not the rate of change — it would take much longer to notice an unexpected power drain from the percentage alone.

Mike Flegel:

“Mileage estimates in a Tesla depend on a lot of factors, so we’re going to get rid of Distance-to-Empty. You’re welcome.”

Update (2016-12-14): John Gruber:

I know iOS has never had a time remaining estimate. That’s fine for iOS. I think it’s useful on MacBooks, especially just as a loose estimate.


On iOS, the battery % indicator is not a battery % indicator. It’s a time remaining, converted to % with some fudge factors.

This is why on iOS you can sometimes see the battery % go up after you exit a power hungry app.

There is more information about that here and here.

Update (2016-12-15): You can still get time remaining estimates using Activity Monitor, iStat Menus, Outlet, and pmset.

Update (2016-12-27): Kaspars Dambis (via Hacker News):

Assuming that macOS is pulling the battery estimates from the TI chip (see pages 16 and 17 of the datasheet for all the available data fields) it is possible that the algorithms used by the chip don’t account for certain power usage behaviours of various components (for example, power saving modes) which produced wildly inaccurate estimates.


Here is a great paper on the internals of the MacBook battery by Charlie Miller and a video of his talk at DEFCON 2013 on the same subject[…]

Update (2020-01-24): Nick Heer:

A weird and also horrible thing about using MacOS these days is having to open the Energy panel in Activity Monitor to see how much time you have left on battery.

Update (2020-04-20): Tanner Bennett:

BetterTouchTool has a battery widget for the Touch Bar which can display time remaining.