From 727c99b7297521d9d08c2335d2eff015f55a1cd7 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 22 Jan 2021 05:28:46 -0800 Subject: [PATCH] Introduce support for no hardware acceleration Summary: Start flipper with `--no-launcher --disable-gpu` to disable hardware acceleration Reviewed By: passy Differential Revision: D25994355 fbshipit-source-id: e75bb209c8e3325135a114bec1f25889187d2728 --- desktop/static/main.ts | 11 +++++++++++ docs/troubleshooting.mdx | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/desktop/static/main.ts b/desktop/static/main.ts index 13a49d61f..098ec85b5 100644 --- a/desktop/static/main.ts +++ b/desktop/static/main.ts @@ -82,6 +82,12 @@ const argv = yargs default: false, type: 'boolean', }, + 'disable-gpu': { + describe: + 'Disable hardware acceleration. Corresponds to FLIPPER_DISABLE_GPU=1.', + default: false, + type: 'boolean', + }, }) .version(VERSION) .help() @@ -93,6 +99,11 @@ if (isFB && process.env.FLIPPER_FB === undefined) { process.env.FLIPPER_FB = 'true'; } +if (argv['disable-gpu'] || process.env.FLIPPER_DISABLE_GPU === '1') { + console.warn('Hardware acceleration disabled'); + app.disableHardwareAcceleration(); +} + process.env.CONFIG = JSON.stringify(config); // possible reference to main app window diff --git a/docs/troubleshooting.mdx b/docs/troubleshooting.mdx index fefaa4fac..c613b1cbd 100644 --- a/docs/troubleshooting.mdx +++ b/docs/troubleshooting.mdx @@ -29,6 +29,11 @@ We hope that flipper works well out of the box, but the software is a work in pr * Delete Flipper from your applications folder and redownload [Flipper](https://www.facebook.com/fbflipper/public/mac). * If you're using `yarn start` to run from source, make sure all dependencies are installed correctly by running yarn install. +### Flipper shows weird render artifacts + +This is a long standing MacOS + Electron issue outside our control. In general restarting your computer fixes the problem. +For a quick, temporarily work around start Flipper with hardware acceleration disabled. Please note that this will consume a lot of CPU: `FLIPPER_DISABLE_GPU=1 open -a Flipper`. + ### iOS Simulator missing from devices dropdown * Check that `xcode-select -p` shows the same XCode version that you're using. If not, see xcode-select for how to select the correct version.