[0.12.x] [Michal] Game not detecting GPU properly when not using opengl
[0.12.x] [Michal] Game not detecting GPU properly when not using opengl
specs:
Laptop Samsung rf511
CPU:Intel Core i5-2410M
GPUs:
1: Intel HD graphics 3000
2:nVidia GeForce GT 540M
Factorio version: 0.12.13
as per title, no matter what fidling i do with game and optimus, only one that is seen and grabbed is GPU no.1(as seen in factorio-current-noForceOGL.log file) but is detecting properly when forceOpenGL option is set to true (logfile factorio-currentForceOGL.log).
Also attaching file DisplayInfo.txt from EnumDisplays posted here https://forums.factorio.com/forum/viewtop ... 11&t=16287
Laptop Samsung rf511
CPU:Intel Core i5-2410M
GPUs:
1: Intel HD graphics 3000
2:nVidia GeForce GT 540M
Factorio version: 0.12.13
as per title, no matter what fidling i do with game and optimus, only one that is seen and grabbed is GPU no.1(as seen in factorio-current-noForceOGL.log file) but is detecting properly when forceOpenGL option is set to true (logfile factorio-currentForceOGL.log).
Also attaching file DisplayInfo.txt from EnumDisplays posted here https://forums.factorio.com/forum/viewtop ... 11&t=16287
- Attachments
-
- DisplayInfo.txt
- (4.42 KiB) Downloaded 410 times
-
- factorio-currentForceOGL.log
- (1.24 KiB) Downloaded 415 times
-
- factorio-current-noForceOGL.log
- (1.29 KiB) Downloaded 407 times
Re: Game not detecting GPU properly
Thanks for the report. It is interesting that behavior is different for DirectX and OpenGL. However I have no idea what to change in order to Optimus recognize Factorio as graphics-heavy application. Maybe we should make OpenGL default on Windows. DirectX islot of trouble for us lately. Especially since Windows 10 came out. (Not to blame DirectX or Windows 10; we use DirectX 9 - because of compatibility with WinXP, and it is not big surprise too me that 13 year old API starts making problems on modern hardware)
Re: Game not detecting GPU properly
Would it be possible to actually use DirectX 10?
It could help with all those strange problems. Win XP support is a bit far fetched currently.
It could help with all those strange problems. Win XP support is a bit far fetched currently.
Re: Game not detecting GPU properly
We use Allegro graphics library. I search for DirectX 10 or 11 backend for Allegro, but didn't find anything. Even though I would be interested in creating DX11 backend by myself, I am not sure if it is worth it and wouldn't make more sense for us to just use OGL.
Re: [0.12.x] Game not detecting GPU properly when not using opengl
Well i dug some more for search on optimus APi and found those:
http://developer.download.nvidia.com/de ... licies.pdf
http://docs.nvidia.com/cuda/optimus-dev ... index.html
http://www.opentk.com/node/3144
and good old stack overflow
http://stackoverflow.com/questions/1053 ... us-laptops
and TL;DR those links, you supposedly can just:
1) either link staticly one of those libs:vcamp110.dll, vcamp110d.dll, nvapi.dll, nvapi64.dll, opencl.dll, nvcuda.dll, and cudart*.*.
2)exporting Global Variable NvOptimusEnablement
3)create profile? im not sure about this one from opentk.com
idk how viable any of those are for you but hopefully you find something worthwile:) also if you need testing that out im willing to help with this one
http://developer.download.nvidia.com/de ... licies.pdf
http://docs.nvidia.com/cuda/optimus-dev ... index.html
http://www.opentk.com/node/3144
and good old stack overflow
http://stackoverflow.com/questions/1053 ... us-laptops
and TL;DR those links, you supposedly can just:
1) either link staticly one of those libs:vcamp110.dll, vcamp110d.dll, nvapi.dll, nvapi64.dll, opencl.dll, nvcuda.dll, and cudart*.*.
2)exporting Global Variable NvOptimusEnablement
3)create profile? im not sure about this one from opentk.com
idk how viable any of those are for you but hopefully you find something worthwile:) also if you need testing that out im willing to help with this one
Re: [0.12.x] Game not detecting GPU properly when not using opengl
I don't think it's Factorio's responsibility to determine which GPU to use. Normally in a multi-GPU setup the GPU switching software on the OS determines that - at least in every multi GPU setup I've ever seen that's how it worked.
I've also never seen a multi-GPU setup that worked well. I've always just ended up disabling the lower end one due to bugs around it. You'll probably be better off doing that as well.
I've also never seen a multi-GPU setup that worked well. I've always just ended up disabling the lower end one due to bugs around it. You'll probably be better off doing that as well.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12.x] Game not detecting GPU properly when not using opengl
@piron1991: That is not what I had in mind, but the solution with global variable is simple enough (and non-intrusive enough) that we will give it a try. Thank you for finding it for us
But I agree with Rseding, that things like this, that are completely outside of standard graphical API and should be handled by graphical driver are not our bugs, but driver issues.
EDIT: I preprared it for 0.12.16. Please let us know if it helps
But I agree with Rseding, that things like this, that are completely outside of standard graphical API and should be handled by graphical driver are not our bugs, but driver issues.
EDIT: I preprared it for 0.12.16. Please let us know if it helps
-
- Filter Inserter
- Posts: 436
- Joined: Wed Jan 15, 2014 9:41 am
- Contact:
Re: [0.12.x] Game not detecting GPU properly when not using opengl
One think to add to this wen you go to stem, stem add some "thing" inbetreen the game and the OS. if the games are locked/can not be play with stem this can mack game unplayer, as it all way find the on CPU GPU. i have 4 games like this stoping the CPU GPU fixs 3 of them so it is a good think to fix/ have the plck what one to use.
Re: [0.12.x] Game not detecting GPU properly when not using opengl
i kinda agree with Rseding91 too but kinda not, thing is laptops doesnt allow disabling intel gpus as their bios are stripped down, and as such i just cant do that, and even if i wouldnt probably do this unless i would want to fry it on yt vids. And optimus was always an issue as early on you as game dev would be forced to cooperate with nvidia to have a profile for game created and hope its gonna be released with next driver iteration, and well even if i could disable i still belive fixing that is worth more than my ability to turn GPU off as it could potentialy improve reception of game when you get on steam from people playing games on laptops too:)
posila i will say how it went as soon as i get my hands on 12.16 as i like playing with mods and having half of memory eaten by intel is not fun
posila i will say how it went as soon as i get my hands on 12.16 as i like playing with mods and having half of memory eaten by intel is not fun
Re: [0.12.x] Game not detecting GPU properly when not using opengl
I've been using .12.2
All the recent versions since that one, the game is very choppy. I'm not sure what they did to make it like that, it's unplayable =(
All the recent versions since that one, the game is very choppy. I'm not sure what they did to make it like that, it's unplayable =(
Re: [0.12.x] Game not detecting GPU properly when not using opengl
Reporting on 0.12.16: partial sucess
Game was detected by nvidia this time, but logs still says using Intel gpu, and from quick test it does seem to still use it:(
Attaching log as proof.
And a tought i had when i saw log, is it possible that allegro detects all displays but select first found, and if so is it doable to select best one instead somehow?Like iterate over displays, if nvidia/ati found prioritize it?
Game was detected by nvidia this time, but logs still says using Intel gpu, and from quick test it does seem to still use it:(
Attaching log as proof.
And a tought i had when i saw log, is it possible that allegro detects all displays but select first found, and if so is it doable to select best one instead somehow?Like iterate over displays, if nvidia/ati found prioritize it?
- Attachments
-
- factorio-current.log
- (1.31 KiB) Downloaded 400 times
Re: [0.12.x] [Michal] Game not detecting GPU properly when not using opengl
Hmm, hmm ... thanks for the report.
Allegro sees only adapters there are listed in the log:
Even when running on OpenGL, the available display adapters list shows only the Intel card. I assume Optimus makes some magic when OpenGL is initialized, and makes it run on discrete GPU. Since there is just one adapter, Allegro will pass index 0 to DirectX, which DirectX interprets as "use primary adapter". That should be the most ideal case for Optimus to do its magic. Maybe the problem is that Allegro uses DirectX 9 and when Optimus sees it, it thinks the game is so old even Intel GPU can handle it
Could you download this tool that enumerates all display adapters and see if it lists the nVidia?
By the way, what do you mean by "Game was detected by nVidia"?
Anyway, I won't do any changes to how Allegro selects adapters. I already tried to "improve" on it in 0.12.7 and it was complete disaster. Just use force-opengl
Allegro sees only adapters there are listed in the log:
Code: Select all
1.444 Available display adapters: 1
1.444 [0]: \\.\DISPLAY1 - Intel(R) HD Graphics 3000 {0x05, [0,0], 1366x768, 32bit, 60Hz}
Could you download this tool that enumerates all display adapters and see if it lists the nVidia?
By the way, what do you mean by "Game was detected by nVidia"?
Anyway, I won't do any changes to how Allegro selects adapters. I already tried to "improve" on it in 0.12.7 and it was complete disaster. Just use force-opengl
Re: [0.12.x] [Michal] Game not detecting GPU properly when not using opengl
From what i see its same app that log i already posted in first post:) it shows clearly that:
so yea, DISPLAY1 is as expected Intel, but on DISPLAY3 theres Nvidia.
And by "nvidia detected it" i meant that theres list of last open apps when you add new profile for games, and before 0.12.16 factorio was not even on it, while now it showed nicely as last played
Code: Select all
*[0]: \\.\DISPLAY1 - Intel(R) HD Graphics 3000 {0x0005 = AttachedToDesktop, PrimaryDevice}
[all availible resolutions]
[1]: \\.\DISPLAY2 - Intel(R) HD Graphics 3000 {0x8000000 = ModesPruned}
[2]: \\.\DISPLAY3 - NVIDIA GeForce GT 540M {0x0000 = 0}
And by "nvidia detected it" i meant that theres list of last open apps when you add new profile for games, and before 0.12.16 factorio was not even on it, while now it showed nicely as last played
Re: [0.12.x] [Michal] Game not detecting GPU properly when not using opengl
Oh, I long forgot about the first post, sorry for that
Ah, I see. And if you create profile, can you select there you want to use high performance GPU?piron1991 wrote:And by "nvidia detected it" i meant that theres list of last open apps when you add new profile for games, and before 0.12.16 factorio was not even on it, while now it showed nicely as last played
Re: [0.12.x] [Michal] Game not detecting GPU properly when not using opengl
Yep, i can, actually i made sure its not anything on my side that could be derpy and checked if profile is set properly
-
- Filter Inserter
- Posts: 285
- Joined: Thu Jun 09, 2016 5:56 am
- Contact:
Re: [0.12.x] [Michal] Game not detecting GPU properly when not using opengl
OpenGL can be pain in the ass with fullscreen aspects. I know no single game that handles OpenGL correctly under Windows (all Quakes, Riddick, Doom). Many have alt-tab issues. Some have taskbar showing up through them. Some are loosing input while going fullscreen. Even recent Doom is not perfect in this matter. Honestly if not John Carmack fetish for OpenGL, we wouldn't see this API in games at all, it was designed for CAD. It has some modern use though to support Mac gaming, but I think in time Vulcan will finally blow OGL away from gaming scene.
As for multiple adapters and multiple monitors - OS usually picks adapter connected to your primary desktop monitor even if game window is moved to another monitor.
As for multiple adapters and multiple monitors - OS usually picks adapter connected to your primary desktop monitor even if game window is moved to another monitor.