CEF on Windows Server Core missing dxva2.dll

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF on Windows Server Core missing dxva2.dll

Postby mzboray » Wed Jul 08, 2020 7:37 pm

I am trying to use CEF via CefSharp in .NET/C# to take screenshots offscreen. This works for desktop and server windows OSes but I have recently found that it does not work on Windows Server Core OSes. These are stripped down versions of Windows without the "Desktop Experience", i.e. a number of UI features and tools.

From what I can tell, the primary issue is that file dxva2.dll is missing. This relates to DirectX Video Accelation and is included with the desktop server install. Tracing the dependencies of CefSharp I am able to see this is used by libcef.dll which is part of the base CEF project, so I am asking here as there might be some people with more knowledge of this dependency.

I am able to copy the dxva2.dll dll from a full server install and get my application to work. However this is not really a legitimate way for me to distribute it as far as I can tell. So I am trying to find out if I can either
1. Disable any features that might load this component. This seems like it might be possible since I have tested using chrome in headless mode to take screenshots successfully on Server Core.
2. Install dxva2.dll properly on Windows Server Core. I have tried installed the "Media Foundation" windows feature but that did not seem to have an effect. dxva2.dll is not present and is still required to run the application.

I have tested this with CefSharp version 83, which uses CEF version 83.
mzboray
Newbie
 
Posts: 7
Joined: Wed Jul 08, 2020 6:52 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby amaitland » Thu Jul 09, 2020 12:35 am

Have you tried disabling GPU acceleration?
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 745
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF on Windows Server Core missing dxva2.dll

Postby mzboray » Thu Jul 09, 2020 2:16 am

Yes. I tried using CefSharp's CefSettings.DisableGpuAccelation() but it didn't make a difference. I noticed that headless chrome has this option and didn't seem to make a different there either.
mzboray
Newbie
 
Posts: 7
Joined: Wed Jul 08, 2020 6:52 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby amaitland » Thu Jul 09, 2020 5:40 am

To entirely disable the GPU process try using -–disable-gpu -–disable-software-rasterizer

You might also want to try capturing a screenshot in headless chrome of chrome://version and chrome://gpu

See if `Chrome` has applied any special command line args.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 745
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF on Windows Server Core missing dxva2.dll

Postby mzboray » Thu Jul 09, 2020 2:30 pm

Thanks for your help on this.

I tried those flags, but the result was the same. I've noticed from the stack trace and some console logging that the error occurs before the call to the Cef.Initialize where the command line args are passed into CEF, so they probably aren't even having a chance to take effect. Here is the error with stack trace:

Exception:System.IO.FileNotFoundException: Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found.
File name: 'CefSharp.Core.dll'
   at CefBasic.Program.Run(String args)
   at CefBasic.Program.Main(String[] args) in C:\Users\mzboray\source\repos\CefBasic\CefBasic\Program.cs:line 29


I have some console logging right at the start of Run so I can tell it's not even entering the method. I realize now its failing at the stage where it actually loads CefSharp.Core not just failing when calling into Cef.Initialize(). I think there probably isn't a simple workaround with flags passed down to CEF.

I tried to screenshot chrome's gpu and version settings. The version page doesn't seem to load properly (or maybe its just delayed) and I didn't see much difference in the gpu settings between server core and windows 10, but I can keep at it and see if I can get more info on this.
mzboray
Newbie
 
Posts: 7
Joined: Wed Jul 08, 2020 6:52 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby magreenblatt » Thu Jul 09, 2020 2:37 pm

Does Google Chrome or the CEF Sample Application run on the Windows Server Core machine without dxva2.dll?
magreenblatt
Site Admin
 
Posts: 10184
Joined: Fri May 29, 2009 6:57 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby mzboray » Thu Jul 09, 2020 2:48 pm

Full Chrome doesn't work, but a lot of UI applications don't work in Server Core. Full Chrome does work in headless mode because I can take a screenshot successfully with it.
I tried to run the CEF sample application but it also doesn't work. I figured this is because of the UI, so I wasn't really surprised. If there is a headless mode or version I can try, let me know.
mzboray
Newbie
 
Posts: 7
Joined: Wed Jul 08, 2020 6:52 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby magreenblatt » Thu Jul 09, 2020 2:57 pm

Since Chrome headless works to take screenshots does that satisfy your use case?
magreenblatt
Site Admin
 
Posts: 10184
Joined: Fri May 29, 2009 6:57 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby mzboray » Thu Jul 09, 2020 3:18 pm

Not really. I mean screenshots are the primary thing we are using CEF with CefSharp for and it has a lot more control over the whole process (e.g. what resources get loaded from where). We were able to integrate it pretty easily in our existing C# application, and I think switching over to something else would take more time than I can spend on it right now. Also distribution is straight forward (simply pack in CEF in our installer), but with Chrome I'd have to direct users elsewhere to download it, since we probably cannot distribute it.
mzboray
Newbie
 
Posts: 7
Joined: Wed Jul 08, 2020 6:52 pm

Re: CEF on Windows Server Core missing dxva2.dll

Postby magreenblatt » Thu Jul 09, 2020 3:22 pm

I see. In that case you should probably just require a more appropriate Windows version that is intended for running applications.
magreenblatt
Site Admin
 
Posts: 10184
Joined: Fri May 29, 2009 6:57 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 40 guests

cron