Issue regarding WV2 and discrete GPU

0 favourites
  • 8 posts
From the Asset Store
Cordova device Info mobile and browser modules detect-gpu
  • For my game, DinoSystem, I've previously used a workaround to use the discrete GPU of players without forcing them to mess with the NVidia/ATI control panels - i exported the game with NW.js and named the exe "run_game.exe", which in the Nvidia settings is tagged by default with discrete GPU usage.

    I've always wanted to switch to WebView2, since Ashley has plans to fully support C3's own exported and discard NW, which seems a great idea.

    The opportunity to do that arised when i've discovered that adding "--force_high_performance_gpu" to the game's args when exporting makes use to the GPU regardless of the default card settings. So i switched to WebView2.

    But i recently discovered that the game, when exported, runs at 55-56 FPS - it uses the discrete GPU, but looks like it's not fully using it, and there's some subtle jankiness instea dof running butter smooth like preview. I tried to reduce the game's graphics, map size, entities number, nothing worked. Game runs at butter-smooth 60 fps in C3 preview, but 55-56 fps with subtle lag in exported.

    I then enabled discrete GPU usage for WV2 exe in programs/microsoft folder, and... it fixed it.

    So i'm back with NW.js, since i can just keep the "run_game" exe name and use the discete GPU of the user (again, i dont want to ask Steam users to mess with their card settings to play my game..)

    Is there anything else i could do? Are there any fixes, aside --force_high_performance_gpu which doesn't fully solve it, but actually creates a new. more subtle problem? I don't want to stick with NW.js, but seems like i have no choice now.

  • In that post, I mentioned an update in r417 that may help, but nobody has responded to that yet - it'd be interesting to know if it made a difference for anyone.

  • In that post, I mentioned an update in r417 that may help, but nobody has responded to that yet - it'd be interesting to know if it made a difference for anyone.

    WV2 export still doesn't use the discrete GPU, unless i export with --force_high_performance_gpu arg, which, as i mentioned in the post, seems to add an odd janking/stuttering, which is hard to notice but i can guarantee is there for me.

    The only way to fully and properly use the GPU on WV2 for me is to mess with the Nvidia settings and set the WV2 exe (the one in programs/microsoft, not the exported one) to "use full power".

    Still like that after 417.

    On NW.js i can just rename the exe to "run_game", now i can try the tool dop2000 post mentions, which is probably even better.. i'll report back.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley

    I tried the patcher, it doesn't work for WV2 (but does for NW), i suspect the exe that should be patched is not the exported game's exe, but msedgewebview2.exe in program files/microsoft. That's probably why the changes in r417 don't work either.

  • It sounds like webview2 was more of an experimental thing, that hasn't really worked out. Particularly there was some issues with Steam too.

    So it's probably better to just stick with Electron and NWJS.

  • It sounds like webview2 was more of an experimental thing, that hasn't really worked out.

    NW.js is pretty much unmaintained at this point, and is gradually accumulating weird problems that aren't being fixed and are getting harder and harder to work around, and is also very difficult to integrate custom native code with. I would not be surprised if NW.js is retired at some point soon, so part of our recent efforts is to mitigate this if it happens. WebView2 on the other hand is actively maintained by Microsoft, they've already added a significant feature I requested, doesn't require constant maintenance from us, and is much easier to integrate custom native code with our wrapper extension architecture (some of which are also significant benefits over Electron too). So I'd actually say it's the other way round.

    When it comes to the handling dual GPU systems (and other things like the Steam Overlay), I think these come down to the multiprocess architecture of browsers and the way third-party tools work which are outside of our direct control. These also remain risks for NW.js and Electron - if you have to rely on hacky workarounds to get things to work with them, and one day the workarounds mysteriously stop working, what then? You need a proper solution, which is what we need to get working with things like WebView2. The best way to do that is to contact GPU vendors and ask them to fix it. I've got in touch with NVidia and AMD to see if they can adjust how their drivers work to support WebView2 with the NvOptimusEnablement/AmdPowerXpressRequestHighPerformance approach. However I would encourage all those affected to also get in touch and request the same thing. People commonly over-estimate how much influence we have: we don't have friends in high places and we usually can only do what anyone else can, and so the best way to make sure our requests get noticed is to have as many of the affected people also request the same thing so they see the popular demand for it. So if you're concerned about this, or other issues beyond our direct control like the Steam Overlay, please add your voice and get in touch with the companies responsible and request changes. Given the risks and maintenance difficulties of NW.js and Electron, we're going to be going ahead with retiring NW.js anyway, but there's going to be ~2 years more of support via LTS for NW.js. So assuming we get some co-operation from the community and the companies responsible, that should be enough time to make sure everything we need for WebView2 is in place before NW.js support is finally fully retired.

  • Since NW is going to be phased out, I'm exploring a possible temporary solution for sticking with WebView2 and allow usage of discrete GPU.

    I'm using the Fixed WV2 export, patching msedgewebview2.exe with the NVPatch. It works (as expected) but the antivirus doesn't like it.

    I'm out of ideas...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)