Page 1 of 1

Cannot start on linux when logged in with mutiple X screens.

Posted: Fri May 25, 2018 5:44 am
by nerwall
Hardware:
CPU: i73930k 6c 12t @ 3.7GHz
GPU0: GeForce GTX 1060 6GB (Factorio should be running on this GPU)
GPU1: GeForce GTX 660
RAM: 8x4GB DDR3

Software:
Kernel: 4.13.0-43-generic X86_64
OS: Ubuntu 17.10
DE: XFCE
WM: Xfwm4
Nvidia Driver: 384.111 (Driver for both GPUs)
X.Org: 1.19.5

Display Configuration:
GPU0 --> X Screen 0 --> Monitor 0 2560x1440@60Hz, Monitor 1 1600x900@60Hz, Monitor 2 1440x900@60Hz, Monitor 3 1920x1200@60Hz
GPU1 --> X Screen 1 --> Monitor 4 1280x1024@75, Monitor 5 1280x1024@75

I am logged in with 1 desktop that is spanned across multiple X screens, each of which is spanned across multiple physical monitors. I am running multiple heterogenous GPUs since a single 1060 can drive at most 4 monitors and I have more than that. Factorio should be starting on Screen 0 on monitor 0 in fullscreen, that was what happened before I added the second GPU and final three monitors. Instead of this Factorio crashes on startup before even opening a window, this happens on 0.15.40 (Seablock) as well as on 0.16.42, additionally, the --fullscreen false command line argument does not seem to affect the crash. Attached are Several logs, My /etc/X11/xorg.conf and the output of xrandr and nvidia-xconfig commands since the factorio log seems to mention xrandr.

Re: Cannot start on linux when logged in with mutiple X screens.

Posted: Fri May 25, 2018 1:21 pm
by Oxyd
Thanks for the report. I don't have a setup crazy enough to reproduce it, but I think I found the cause of the crash. So, hopefully it will be fixed in 0.16.46.

Re: Cannot start on linux when logged in with mutiple X screens.

Posted: Fri May 25, 2018 10:03 pm
by nerwall
I have narrowed down the minimum possible configuration that causes the crash, I can be done on a computer with 1 GPU and 3 monitors. There just need to be at least 2 X screens and Factorio should be started from a terminal on the X screen that is spanned across 2 of the monitors. Attached are the files from the minimum crashing config.

The steps to reproduce, if you want to try, are as follows.
  1. Plug three monitors into a newish Nvidia card
  2. Boot into a linux environment running XFCE and Xfwm4. (Xubuntu works)
  3. Make sure the system is running the Nvidia Proprietary driver.
  4. Open the Nvidia X server settings application.
  5. Select the "X Server Display Configuration" tab.
  6. Select one of the three monitors, switch the "Configuration:" dropdown from "X Screen 0" to "New X Screen".
  7. Click "Save to X Configuration File" and name the file "xorg.conf". (requires password of sudoer)
  8. Press the "<Ctrl>+<Alt>+<F1>" Key combination to switch to tty1.
  9. Log in to user account in terminal.
  10. Run command "sudo service lightdm restart".(Or whatever your display manager and Init system are)
  11. Log in to graphical environment again.
  12. Start Factorio and watch it crash.
EDIT: For 0.16.46 the requirements have changed slightly. If both X screens are run from the same GPU and Screen 1 has only one monitor then Factorio will start on Screen 0 regardless of what screen it is started from. To reproduce the crash, 4 monitors or 2 GPUs are now needed. (2 monitors per X screen or 1 screen per GPU).

Re: Version 0.16.46

Posted: Wed May 30, 2018 1:41 am
by nerwall
FactorioBot wrote:Bugfixes
  • Another possible fix for multi-GPU setups on Linux. (60609)
Unfortunately it looks like this did not fix the issue. Attached are the newest log and dump. The reproduction steps in my comment on the bug report page still work, but I understand if changing up your setup is too much for a bug that is so specific to a very rare setup.
EDIT: It looks like this fixes the bug, but only if the second X screen contains only one monitor. If the second X screen has two monitors it still crashes. Additionally, if Factorio is started from an X screen other than 0, it will still start on screen 0, unlike most X applications.

Re: Cannot start on linux when logged in with mutiple X screens.

Posted: Wed May 30, 2018 4:54 am
by Ericwu91
Holy moses, that's a crazy configuration.

Re: Cannot start on linux when logged in with mutiple X screens.

Posted: Wed May 30, 2018 5:34 am
by Koub
[Koub] Moved nerwall's last post here (from minor update topic)

Re: Cannot start on linux when logged in with mutiple X screens.

Posted: Wed May 30, 2018 6:02 am
by nerwall
Here is a picture XD. Image

Re: Version 0.16.46

Posted: Wed May 30, 2018 11:47 am
by Oxyd
nerwall wrote:
FactorioBot wrote:Bugfixes
  • Another possible fix for multi-GPU setups on Linux. (60609)
Unfortunately it looks like this did not fix the issue. Attached are the newest log and dump. The reproduction steps in my comment on the bug report page still work, but I understand if changing up your setup is too much for a bug that is so specific to a very rare setup.
EDIT: It looks like this fixes the bug, but only if the second X screen contains only one monitor. If the second X screen has two monitors it still crashes. Additionally, if Factorio is started from an X screen other than 0, it will still start on screen 0, unlike most X applications.
I see. I guess it's a more complicated problem than it first seemed. It's caused by Allegro and, as you may have heard, we are planning to move away from Allegro with 0.17. So let's wait for 0.17 with this bug.

Re: Cannot start on linux when logged in with mutiple X screens.

Posted: Thu Feb 28, 2019 6:40 am
by nerwall
This issue has been resolved in 0.17.0, everything is working as expected on my funky system.