This post is primarily a reminder for myself on how to purge/reset the ColorSync user cache.
I’ve got a mid-2010 15″ MacBook Pro, which was the first having both an integrated GPU (Intel HD) and a dedicated GPU (NVidia Geforce GT 330M). It “dynamically” switches between the two on-demand, which means some applications (e.g. Adobe Photoshop, Google Chrome, Visual Studio Code) trigger the switch, probably because of some low-level GPU call that makes OS X decide the dedicated GPU must be used.
Now, since a while, when the MBP would switch from the internal GPU (iGPU) to the dedicated GPU (dGPU), the screen would change colour. It would change from its correct colour to a somewhat blue-ish tint. Very bad on the eyes, especially in the evening.
After googling around a lot, a number of posts on the Apple Discussions pages recommend gfxCardStatus, using which you can “lock” the MBP on the iGPU. I consider this a bad option (it’s not bad software by the way, I’ve used it in the past to monitor the GPU switching), since the dGPU is far more powerful than the iGPU and often you need that power (be it the dedicated memory or the computation power). And, when you attach an external screen (like I do most of the times), it doesn’t work at all.
I also found the recommendation to reset or purge the ColorSync user cache. I tried this and it immediately worked, removing the blue-ish tint from the MBP screen (well, after removing the ColorSync cache and restarting the MBP).
The easiest way to do this (in my opinion), is described by Topher Kessler on CNET.com in his post titled “How to make ColorSync profiles stick in OS X”. It took me a while to find it because the title doesn’t immediately give away the fact that it concerns the ColorSync cache.
So, long story short, execute the following in the Terminal:
sudo rm $(getconf DARWIN_USER_CACHE_DIR)com.apple.colorsync.profiles.`id -u`
…which gets rid of the existing ColorSync user cache. Restart afterwards and the screen will maintain the same colour on both the iGPU and the dGPU.
I don’t know why or how the ColorSync user cache gets corrupted, but I do know how to solve it!