Skip to content

Feature Request - ARM64 support #2944

Description

@NeomMob

We are starting now to see some new devices from Microsoft using ARM64 architecture. I am wondering if there is a forecasted support for them.

Activity

  1. kpreisser commented on Oct 28, 2019

    @kpreisser
    Contributor

    See also dotnet/winforms#2053 and dotnet/wpf#1817 for the progress of Windows ARM64 support in .NET Core, including WinForms and WPF.

  2. amaitland commented on Nov 6, 2019

    @amaitland
    Member

    I personally have no plans to support Win ARM64, I don't own a suitable device.

    For background.

  3. amaitland commented on Nov 6, 2019

    @amaitland
    Member

    Someone else is welcome to take responsibility for adding and supporting Win ARM64. An ongoing commitment would be required.

  4. amaitland commented on Jan 20, 2020

    @amaitland
  5. amaitland commented on Jan 12, 2021

    @amaitland
    Member

    Official Windows ARM64 builds starting with M88 will be available shortly from https://cef-builds.spotifycdn.com/index.html#windowsarm64.

    As per https://bitbucket.org/chromiumembedded/cef/issues/2773/windows-add-arm64-build-support#comment-59706180

    This is blocked on the linker errors when attempting to compiler CefSharp.Core.Runtime targeting .Net 5.0 (required for ARM64). As reported in #3284 (comment) which I've confirmed as being a problem.

    2>MSVCMRTD_netcore.LIB(mstartup.obj) : error LNK2022: metadata operation failed (80131195) :
    2>MSVCMRTD_netcore.LIB(mstartup.obj) : error LNK2022: metadata operation failed (80131195) :
    2>MSVCMRTD_netcore.LIB(mstartup.obj) : error LNK2022: metadata operation failed (80131195) :
    2>LINK : fatal error LNK1255: link failed because of metadata errors
    

    The CefSharp.BrowserSubprocess.Core project compiles successfully, it's less complicated though, it's possible there's just a linker setting that's causing the problem or we might need to raise an issue with Net 5 Team.

  6. amaitland commented on Jan 13, 2021

    @amaitland
    Member

    For anyone interested in tacking this it looks like the first build is up on https://cef-builds.spotifycdn.com/index.html#windowsarm64

    First step would be working out how to generate libcef_dll_wrapper.lib

    Currently https://github.com/cefsharp/cef-binary/blob/master/build.ps1 downloads, builds and packages the x86/x64 versions, it should be possible (haven't tried obviously) to extend this to download, build and package the arm64 target binaries.

  7. added a commit that references this issue on Jan 15, 2021
  8. kpreisser commented on Jan 16, 2021

    @kpreisser
    Contributor

    This is blocked on the linker errors when attempting to compiler CefSharp.Core.Runtime targeting .Net 5.0 (required for ARM64). As reported in #3284 (comment) which I've confirmed as being a problem.

    Note that switching to net5.0 might not actually be necessary for supporting arm64 in CefSharp. With cef.sdk 88.1.2 that includes the ARM64 versions of libcef.lib and libcef_dll_wrapper.lib (from cefsharp/cef-binary#90), I was able to successfully compile CefSharp.Core.Runtime and CefSharp.BrowseSubprocess.Core after adding arm64 as platform target, and confirmed with dumpbin.exe /headers that the produced DLLs (ijwhost.dll, CefSharp.Core.Runtime.dll, CefSharp.BrowserSubprocess.Core.dll) are actually ARM64 DLLs.

    I still need to check whether building a CefSharp WinForms/OffScreen app for win-arm64 with .NET 5.0 and running it on a Windows 10 on ARM machine actually works (WPF is not yet supported for win-arm64).

  9. added 3 commits that reference this issue on Jan 16, 2021
    2b366d3
    538f31e
    6653188
  10. 11 remaining items

  11. amaitland commented on Aug 29, 2021

    @amaitland
    Member

    I also wanted give an updated feedback from our side:

    @kpreisser Great, thanks for the feedback 👍

    But I suppose you could just go ahead and give it to the public since it doesn't jeopardize other architectures in any way,

    @A-Ovchinnikov-mx I would personally like to include ARM64 support in version 93 as it would save me some time as I can finally create the release branch from master which includes ARM64 support.

  12. amaitland commented on Aug 29, 2021

    @amaitland
    Member

    Anyone who is interested in ARM64 support and has some time please check out a CI build and report back. Thanks.

  13. added this to the 93.1.x milestone on Sep 5, 2021
  14. amaitland commented on Sep 5, 2021

    @amaitland
    Member

    ARM64 has been included in 93.1.110-pre see #3780 (comment) for release details.

    Please be aware that I'm relying on community to provide support for ARM64 as I personally don't own an ARM64 device.

  15. kpreisser commented on Oct 7, 2021

    @kpreisser
    Contributor

    Hi,

    we now discovered an issue when using CefSharp.Wpf.HwndHost in a .NET 5.0 WPF app on Windows ARM64 when using a graphics card with hardware acceleration, and when publishing the app as self-contained application. However, it seems the issue itself is not caused by CEF/CefSharp.

    The issue is that when starting the application and loading a URL, sometimes the Chromium Browser just "hangs" (displays a white page), and we can see that the renderer process has high CPU usage. However, it seems to be timing related as the issue doesn't always occur.

    When enable logging (with default log level), and the hang issue occurs, the log file shows the following:

    CEF logfile contents
    [1007/102117.812:WARNING:angle_platform_impl.cc(49)] Debug.cpp:180 (insertMessage): GL error: HIGH: Internal D3D11 error: HRESULT: 0x8007000E: Error finding D3DCompile entry point.
    [1007/102117.813:ERROR:shared_context_state.cc(73)] Skia shader compilation error
    ------------------------
    // Vertex SKSL
    uniform float4 sk_RTAdjust;in float2 position;in half4 color;out half4 vcolor_Stage0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
    vcolor_Stage0 = color;sk_Position = position.xy01;}
    // Fragment SKSL
    in half4 vcolor_Stage0;void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
    half4 outputColor_Stage0;outputColor_Stage0 = vcolor_Stage0;const half4 outputCoverage_Stage0 = half4(1);{ // Xfer Processor: Porter Duff
    sk_FragColor = outputColor_Stage0 * outputCoverage_Stage0;}}
    // Vertex GLSL
    #version 100
    
    precision mediump float;
    precision mediump sampler2D;
    uniform highp vec4 sk_RTAdjust;
    attribute highp vec2 position;
    attribute mediump vec4 color;
    varying mediump vec4 vcolor_Stage0;
    void main() {
        vcolor_Stage0 = color;
        gl_Position = vec4(position, 0.0, 1.0);
        gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
    }
    
    // Fragment GLSL
    #version 100
    
    precision mediump float;
    precision mediump sampler2D;
    varying mediump vec4 vcolor_Stage0;
    void main() {
        mediump vec4 outputColor_Stage0;
        outputColor_Stage0 = vcolor_Stage0;
        {
            gl_FragColor = outputColor_Stage0;
        }
    }
    
    
    Errors:
    
    [1007/102117.817:ERROR:shared_context_state.cc(797)] SharedContextState context lost via Skia OOM.
    [1007/102117.817:ERROR:gpu_service_impl.cc(945)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
    [1007/102117.860:ERROR:gpu_process_host.cc(956)] GPU process exited unexpectedly: exit_code=34
    [1007/102117.860:WARNING:gpu_process_host.cc(1269)] The GPU process has crashed 1 time(s)
    [1007/102118.018:WARNING:gpu_process_host.cc(984)] Reinitialized the GPU process after a crash. The reported initialization time was 15 ms
    [1007/102118.080:WARNING:angle_platform_impl.cc(49)] Debug.cpp:180 (insertMessage): GL error: HIGH: Internal D3D11 error: HRESULT: 0x8007000E: Error finding D3DCompile entry point.
    [1007/102118.080:ERROR:shared_context_state.cc(73)] Skia shader compilation error
    ------------------------
    // Vertex SKSL
    uniform float4 sk_RTAdjust;in float2 position;in half4 color;out half4 vcolor_Stage0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
    vcolor_Stage0 = color;sk_Position = position.xy01;}
    // Fragment SKSL
    in half4 vcolor_Stage0;void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
    half4 outputColor_Stage0;outputColor_Stage0 = vcolor_Stage0;const half4 outputCoverage_Stage0 = half4(1);{ // Xfer Processor: Porter Duff
    sk_FragColor = outputColor_Stage0 * outputCoverage_Stage0;}}
    // Vertex GLSL
    #version 100
    
    precision mediump float;
    precision mediump sampler2D;
    uniform highp vec4 sk_RTAdjust;
    attribute highp vec2 position;
    attribute mediump vec4 color;
    varying mediump vec4 vcolor_Stage0;
    void main() {
        vcolor_Stage0 = color;
        gl_Position = vec4(position, 0.0, 1.0);
        gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
    }
    
    // Fragment GLSL
    #version 100
    
    precision mediump float;
    precision mediump sampler2D;
    varying mediump vec4 vcolor_Stage0;
    void main() {
        mediump vec4 outputColor_Stage0;
        outputColor_Stage0 = vcolor_Stage0;
        {
            gl_FragColor = outputColor_Stage0;
        }
    }
    
    
    Errors:
    
    [1007/102118.094:ERROR:shared_context_state.cc(797)] SharedContextState context lost via Skia OOM.
    [1007/102118.094:ERROR:gpu_service_impl.cc(945)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
    [1007/102118.104:ERROR:gpu_process_host.cc(956)] GPU process exited unexpectedly: exit_code=34
    [1007/102118.104:WARNING:gpu_process_host.cc(1269)] The GPU process has crashed 2 time(s)
    [1007/102118.229:WARNING:gpu_process_host.cc(984)] Reinitialized the GPU process after a crash. The reported initialization time was 14 ms
    [1007/102118.235:WARNING:angle_platform_impl.cc(49)] Debug.cpp:180 (insertMessage): GL error: HIGH: Internal D3D11 error: HRESULT: 0x8007000E: Error finding D3DCompile entry point.
    [1007/102118.236:ERROR:shared_context_state.cc(73)] Skia shader compilation error
    ------------------------
    // Vertex SKSL
    uniform float4 sk_RTAdjust;in float2 position;in half4 color;out half4 vcolor_Stage0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
    vcolor_Stage0 = color;sk_Position = position.xy01;}
    // Fragment SKSL
    in half4 vcolor_Stage0;void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
    half4 outputColor_Stage0;outputColor_Stage0 = vcolor_Stage0;const half4 outputCoverage_Stage0 = half4(1);{ // Xfer Processor: Porter Duff
    sk_FragColor = outputColor_Stage0 * outputCoverage_Stage0;}}
    // Vertex GLSL
    #version 100
    
    precision mediump float;
    precision mediump sampler2D;
    uniform highp vec4 sk_RTAdjust;
    attribute highp vec2 position;
    attribute mediump vec4 color;
    varying mediump vec4 vcolor_Stage0;
    void main() {
        vcolor_Stage0 = color;
        gl_Position = vec4(position, 0.0, 1.0);
        gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
    }
    
    // Fragment GLSL
    #version 100
    
    precision mediump float;
    precision mediump sampler2D;
    varying mediump vec4 vcolor_Stage0;
    void main() {
        mediump vec4 outputColor_Stage0;
        outputColor_Stage0 = vcolor_Stage0;
        {
            gl_FragColor = outputColor_Stage0;
        }
    }
    
    
    Errors:
    
    [1007/102118.237:ERROR:shared_context_state.cc(797)] SharedContextState context lost via Skia OOM.
    [1007/102118.237:ERROR:gpu_service_impl.cc(945)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
    [1007/102118.259:ERROR:gpu_process_host.cc(956)] GPU process exited unexpectedly: exit_code=34
    [1007/102118.259:WARNING:gpu_process_host.cc(1269)] The GPU process has crashed 3 time(s)
    [1007/102118.387:ERROR:angle_platform_impl.cc(44)] Display.cpp:878 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:845.
    [1007/102118.387:ERROR:gl_surface_egl.cc(780)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:845.
    [1007/102118.387:ERROR:gl_surface_egl.cc(1375)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
    [1007/102118.387:ERROR:gl_initializer_win.cc(141)] GLSurfaceEGL::InitializeOneOff failed.
    [1007/102118.388:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
    [1007/102118.502:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is 
    [1007/102118.504:WARNING:gpu_process_host.cc(984)] Reinitialized the GPU process after a crash. The reported initialization time was 0 ms
    
    

    Notice the error about the missing D3DCompile entry point, which I think refers to the D3DCompiler_47.dll file. This file is not present in the Windows 10/11 SDK for arm64 (so it isn't included in the CEF redist for win-arm64), but is present in the system32 directory on Windows ARM64. However, when publishing a WPF application in .NET 5, it seems the .NET SDK also copies a D3DCompiler_47.dll file in the application's directory which is nearly empty (only 26.3 KB instead of a few MB) and doesn't seem to have any function exports (the file is contained in the Microsoft.WindowsDesktop.App.Runtime.win-arm64 package).

    When I delete this small D3DCompiler_47.dll file from the app directory and remove the corresponding entry in app.deps.json, the application works without problems and the browser no longer hangs.

    Note that when publishing a WPF app for x64/x86, there is no D3DCompiler_47.dll file copied to the app directory; instead, it deploys a D3DCompiler_47_cor3.dll file with similar size and exports as the regular file. For ARM64 however, there is no D3DCompiler_47_cor3.dll file deployed, but the small D3DCompiler_47.dll file.

  16. kpreisser commented on Oct 7, 2021

    @kpreisser
    Contributor

    Hi @A-Ovchinnikov-mx,
    thanks for your reply!

    I have reported this issue about D3DCompiler_47.dll in dotnet/wpf#5462.

  17. kpreisser commented on Oct 8, 2021

    @kpreisser
    Contributor

    Additionally, I think we need to change DependencyChecker to not check for D3DCompiler_47.dll for win-arm64 (as it's not included in chromiumembeddedframework.runtime.win-arm64):

    public static string[] CefOptionalDependencies =
    {
    // Angle and Direct3D support
    // Note: Without these components HTML5 accelerated content like 2D canvas, 3D CSS and WebGL will not function.
    "libEGL.dll",
    "libGLESv2.dll",
    "d3dcompiler_47.dll",
    //Crashpad support
    "chrome_elf.dll"
    };

    Currently, it always checks for the presence of D3DCompiler_47.dll. This works currently due to the stub DLL deployed by the .NET SDK, but once this is fixed and that file is no longer copied, the dependency check would fail when running on ARM64.

  18. added a commit that references this issue on Oct 15, 2021
  19. kpreisser commented on May 11, 2022

    @kpreisser
    Contributor

    I have reported this issue about D3DCompiler_47.dll in dotnet/wpf#5462.

    Just a follow-up: The fix for this issue has been backported to .NET 6.0 and is expected to be included in the June 2022 release (6.0.6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions