Skip to content

CefSharp WPF Browser Fails in Startup Context – GPU Context Fatal Failure #5210

@vxiber

Description

@vxiber

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

143.0.90

Operating System

Windows 11

Architecture

x64

.Net Version

4.7.2

Implementation

WPF

Reproduction Steps

Dear Support Team,

We are facing a persistent issue with CefSharp.Wpf version 143.0.90 in a production kiosk-style Windows application. The browser component operates correctly during manual execution but fails when the application is launched via Windows logon mechanisms or elevated contexts.


Application Environment

  • Framework: WPF (.NET)

  • CefSharp Version: 143.0.90

  • OS: Windows 10/11 (Hardened kiosk environment)

  • Deployment Mode: Auto-start at Windows logon via Task Scheduler

  • Execution Context Tested:

    • Standard user manual launch → Works
    • Run as Administrator → Fails
    • Task Scheduler at logon → Fails
    • Windows startup automation → Fails

Observed Behavior

The application loads successfully, and execution reaches browser creation:

ParentGrid.Children.Add(browser);

However, the Chromium browser never renders. No managed exception is thrown at the application level. Logs indicate GPU process failure.


Relevant CEF Log Entries

[ERROR:gpu\ipc\service\gpu_channel_manager.cc:911]
ContextResult::kFatalFailure: Failed to create shared context for virtualization.

Also observed (non-blocking warning):

Desktop Identity Consistency cannot be enabled as no OAuth client ID and client secret have been configured.

Key Findings

  1. Issue occurs only when launched in early logon / elevated session contexts

    • Suggests GPU / DWM / session readiness timing issue.
  2. Browser subprocess appears to start and terminate silently

    • No WPF-level exception.
    • Indicates GPU or sandbox initialization failure in Chromium subprocess.
  3. CEF Initialization Constraints

    • We encountered and resolved duplicate initialization:

      Cef.Initialize can only be called once per process
      
    • Initialization is now centralized in App.xaml.cs at process startup.


Mitigation Steps Already Attempted

We have implemented all of the following:

Startup & Session Handling

  • Task Scheduler configured:

    • Run only when user is logged on
    • No highest privileges
    • Delayed start (30–60 seconds)
  • Browser initialization delayed after window render

Sandbox & Subprocess

  • Explicit BrowserSubprocessPath configured

  • Disabled sandbox:

    • no-sandbox
    • disable-gpu-sandbox

GPU Mitigation

We applied GPU-disabling switches:

  • disable-gpu
  • disable-gpu-compositing
  • disable-d3d11
  • in-process-gpu

(Handled via indexer assignment to avoid duplicate key exceptions, as some switches appear to be auto-injected by CEF.)

User Profile & Cache

  • Custom cache path set under LocalApplicationData
  • Confirmed directory accessibility

Current Status

Despite disabling GPU and sandbox features, the browser still fails to render when started via logon/startup context, while continuing to work perfectly in manual launch.

This strongly suggests a Chromium GPU virtualization or session initialization limitation in non-standard Windows logon timing scenarios.


Assistance Requested

We would appreciate clarification on:

  1. Whether CEF officially supports execution during Windows logon phase before full DWM/GPU session readiness.
  2. If additional flags exist to fully bypass GPU context creation in such environments.
  3. Recommended architecture for kiosk deployments where applications must auto-start at logon.
  4. Whether this behavior is expected with CEF 143 in hardened Windows environments.

This application is used in a controlled kiosk setting where stability at system startup is critical. Any guidance or recommended configuration for such environments would be highly appreciated.

Kind regards,
Asim Khan
Software Architect

Expected behavior

App should run on windows startup and browser should load without crashing

Actual behavior

WPF Application runs properly but crashes as soon as the browser is attached to the parent grid in the window.

Regression?

No response

Known Workarounds

No response

Does this problem also occur in the CEF Sample Application

Yes using WPF/OffScreen command line args

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions