title: The GPU process has crashed x time(s) error using ChromeDriver and Chrome in headless mode along with --disable-gpu and --user-data-dir arguments
body: <p>I am using selenium to open a website. Specifically:</p>
  
  <pre><code>https://storage.googleapis.com/tfjs-models/demos/posenet/camera.html
  </code></pre>
  
  <p>But when it open it using <strong>headless mode</strong>, it displays following error:</p>
  
  <pre><code>[0513/155639.694:WARNING:gpu_process_host.cc(1204)] The GPU process has crashed 1 time(s)
  
  DevTools listening on ws://127.0.0.1:6573/devtools/browser/58f34b20-1a05-4bf0-8e64-1b5a5028b1f6
  [0513/155639.710:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5)
  [0513/155639.710:ERROR:cache_util.cc(138)] Unable to move cache folder C:/Users/Tazim Fatima/AppData/Local/Google/Chrome/User Data\Default\GPUCache to C:/Users/Tazim Fatima/AppData/Local/Google/Chrome/User Data\Default\old_GPUCache_000
  [0513/155639.710:ERROR:disk_cache.cc(184)] Unable to create cache
  [0513/155639.710:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
  [0513/155639.725:WARNING:gpu_process_host.cc(1204)] The GPU process has crashed 2 time(s)
  [0513/155639.725:WARNING:gpu_process_host.cc(1204)] The GPU process has crashed 3 time(s)
  [0513/155639.725:WARNING:gpu_process_host.cc(1204)] The GPU process has crashed 4 time(s)
  [0513/155639.725:WARNING:gpu_process_host.cc(1204)] The GPU process has crashed 5 time(s)
  [0513/155639.725:WARNING:gpu_process_host.cc(1204)] The GPU process has crashed 6 time(s)
  [0513/155639.725:ERROR:browser_gpu_channel_host_factory.cc(153)] Failed to launch GPU process.
  [0513/155642.754:ERROR:service_worker_storage.cc(1624)] Failed to delete the database: Database IO error`enter code here`
  </code></pre>
  
  <p>After lots of searching, i tried:</p>
  
  <pre><code>options.add_argument("--disable-user-media-security=true")
  options.add_argument('--headless')
  options.add_argument("--no-sandbox")  
  options.add_argument("--use-fake-ui-for-media-stream")
  options.add_argument("--disable-gpu")
  options.add_argument("--disable-software-rasterizer")
  options.add_argument('--disable-gpu')
  options.add_argument("--window-size=1280,1024")
  options.add_argument('--disable-dev-shm-usage')
  options.add_argument('--ignore-gpu-blacklist')
  options.add_argument('--use-gl')
  options.add_argument("--user-data-dir=C:/Users/user_name/AppData/Local/Google/Chrome/User Data")
  
  driver = webdriver.Chrome(options=options)
  driver.maximize_window()
  driver.set_window_size(1200, 600)
  driver.set_window_size(1280, 1024)
  driver.get("https://storage.googleapis.com/tfjs-models/demos/posenet/camera.html")
  </code></pre>
  
  <p>Of course not all arguments at once but using different chunks at different times. Though one thing to note here is that when i use the argument <strong>--no-sandbox</strong>, The error changes to</p>
  
  <pre><code>DevTools listening on ws://127.0.0.1:1849/devtools/browser/426a187c-243f-42e3-a0b7-60c4f8dc73b2
  [0513/163007.734:ERROR:gles2_cmd_decoder.cc(3610)] ContextResult::kFatalFailure: fail_if_major_perf_caveat + swiftshader
  [0513/163007.742:ERROR:gles2_cmd_decoder.cc(3610)] ContextResult::kFatalFailure: fail_if_major_perf_caveat + swiftshader
  [0513/163007.754:ERROR:gles2_cmd_decoder.cc(3610)] ContextResult::kFatalFailure: fail_if_major_perf_caveat + swiftshader
  [0513/163007.758:INFO:CONSOLE(20)] "Initialization of backend webgl failed", source: https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js (20)
  [0513/163007.758:INFO:CONSOLE(20)] "Error: WebGL is not supported on this device
      at new e (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:294522)
      at Object.factory (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:346621)
      at t.initializeBackend (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:43098)
      at t.initializeBackendsAndReturnBest (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:44537)
      at t.get [as backend] (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:41137)
      at t.makeTensor (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:48217)
      at Tn (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:81890)
      at Dn (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:81021)
      at o (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:491592)
      at Object.Pp [as decodeWeights] (https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js:20:491626)", source: https://storage.googleapis.com/tfjs-models/demos/posenet/camera.cb338cd2.js (20)
  </code></pre>
  
  <p>And it works. But compared to non headless mode, it is very very slow.</p>
  
  <p>And i can't trade with speed. How can i solve this problem?</p>