About Store Forum Documentation Contact



Post Reply 
APP_EXIT_IMMEDIATELY
Author Message
Fex Offline
Gold Supporter

Post: #16
RE: APP_EXIT_IMMEDIATELY
Houge, are you still looping in InitPre? Or is there some way to make this actually be able to call Update()?
I'm trying as well to do headless linux using Ubuntu 18.04. Downloaded the source, compiled it, compiling the "Project.cpp" using netbeans 8.2. This code still spawns a OpenGL window and crashes.
Code:
void InitPre()
{
   App.flag=APP_ALLOW_NO_XDISPLAY|APP_ALLOW_NO_GPU;
#ifdef DEBUG
   App.flag|=APP_MEM_LEAKS|APP_BREAKPOINT_ON_ERROR;
#endif
   DataPath("../Data");
  
   LogConsole(true);
   LogN("test!");
  
   //Paks.add("engine.pak");
}
Bool Init()
{
    LogN("Init");
   return true;
}
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
    LogN("update");
   if(!App.active())Time.wait(1);
   return true;
}
/******************************************************************************/
void Draw()
{
}

Output:
Code:
test!
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  112
  Current serial number in output stream:  111

I am doing this in a VMware image using their drivers. So I'm not too concerned that I can't run graphics as that is not my goal. I'm just curious if I'm missing something as to why graphics are even spawning. I'd rather rely on the Update() callback than have to loop in InitPre.[/code]
07-31-2020 06:18 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #17
RE: APP_EXIT_IMMEDIATELY
You could compile engine in debug mode under NetBeans, and step by step see which line produces this error.
Or maybe it's just a warning and the app continues to work?
08-01-2020 03:25 AM
Find all posts by this user Quote this message in a reply
Fex Offline
Gold Supporter

Post: #18
RE: APP_EXIT_IMMEDIATELY
Thanks for the idea Greg,

Line 1362 of Display.cpp
Code:
if(MainContext.context=glXCreateContextAttribsARB(XDisplay, GLConfig, null, true, attribs))break; // stop on first found
Generates segfault. Again this may be just because of VMwares gfx driver..

For my purposes, it seems like the problem is XDisplay != null/false when the APP_ALLOW_NO_XDISPLAY is set (line 821 of Application.cpp):

..which I guess makes sense since it is "ALLOW" and not "SET" or "FORCE". Basically I am trying to run esenthel as a terminal app from Desktop (w/ Xwindows) Ubuntu, not actually a real "headless" environment. I'm trying to do so for dev purposes, the real goal is a real headless environment with regards to linux.

So I changed two lines in Application::create1() in Application.cpp to:

Code:
Bool Application::create1()
{
   if(LogInit)LogN("InitPre");
   InitPre();  
#if LINUX
   if(flag&APP_ALLOW_NO_XDISPLAY)XDisplay=null; //FORCE HEADLESS
   if(!XDisplay && !(flag&APP_ALLOW_NO_XDISPLAY))Exit("Can't open XDisplay");
#endif
   if(!testInstance())return false;
       windowCreate();
       InitSound   ();
   if(!InputDevices.create())Exit(MLTC(u"Can't create DirectInput", PL,u"Nie można utworzyć DirectInput"));
   if(!(flag&APP_ALLOW_NO_XDISPLAY))if(!D.create())return false; //FORCE HEADLESS
#if ANDROID
   if(_stay_awake){AWAKE_MODE temp=_stay_awake; _stay_awake=AWAKE_OFF; stayAwake(temp);} // on Android we need to apply this after window was created
#endif
   if(LogInit)LogN("Init");
   if(!Init        ())return false;
   return true;
}

And with limited testing it seems to work as I expect now.
08-02-2020 04:26 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #19
RE: APP_EXIT_IMMEDIATELY
Yes I think the crash is inside the driver.

You could try this:
https://github.com/Esenthel/EsenthelEngi....cpp#L1344
replace
Code:
if(XDisplay)
with
Code:
if(0)
Does that work?
08-02-2020 04:54 PM
Find all posts by this user Quote this message in a reply
Fex Offline
Gold Supporter

Post: #20
RE: APP_EXIT_IMMEDIATELY
Just the change at:
https://github.com/Esenthel/EsenthelEngi....cpp#L1344

And no other changes results in:

"Can't create Constant Buffer" and crash. Which I had happening before when I would just do:

Code:
if(flag&APP_ALLOW_NO_XDISPLAY)XDisplay=null; //FORCE HEADLESS

without:

Code:
if(!(flag&APP_ALLOW_NO_XDISPLAY))if(!D.create())return false; //FORCE HEADLESS

If I remember creating the shaders in D.create()->Sh.create(); wasn't happy so I just killed it all when APP_ALLOW_NO_XDISPLAY flag is set.

For my purposes I just want networking (FastConnection) and physics simulation on linux, and that seems to be working. I could just use PhysX directly without EE on the server side but its just easier using EE on the server and client as it lets them share the same code syntax, I have a working windows server I want to run on headless linux. I use the EE Editor (EE script) currently and not being able to use the EE Editor in a vmware linux vm (maybe I should try virtualbox) is somewhat of a bummer, but not a showstopper as I can port the Visual Studio project output to netbeans.
08-03-2020 04:47 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #21
RE: APP_EXIT_IMMEDIATELY
I've just applied some commits to GitHub source which will allow the engine to work ok if GL / context didn't initialize.
I've tested only on Windows.

I think VirtualBox worked for me in the past, however it was very slow. In the end I've used an old laptop for Linux.
08-05-2020 07:53 AM
Find all posts by this user Quote this message in a reply
Fex Offline
Gold Supporter

Post: #22
RE: APP_EXIT_IMMEDIATELY
In virtualbox (3D acceleration checked in settings), pulled latest source, get this crash when trying to compile/run the "Esenthel Builder.cpp" and "Project.cpp" (Project.cpp also has "TURQ" which is outdated).


Code:
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  127
  Current serial number in output stream:  126

RUN FINISHED; Segmentation fault; core dumped; real time: 490ms; user: 40ms; system: 80ms

Also tried to change Project.cpp flags to:

Code:
App.flag=APP_ALLOW_NO_XDISPLAY|APP_ALLOW_NO_GPU;

Same crash.
08-06-2020 07:08 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #23
RE: APP_EXIT_IMMEDIATELY
Thank you, I've fixed "Project.cpp".

But I still recommend to try this code change:
https://esenthel.com/forum/showthread.ph...1#pid57501

I haven't applied it to the source.

The config used is found here:
https://github.com/Esenthel/EsenthelEngi....cpp#L1822
08-07-2020 06:40 AM
Find all posts by this user Quote this message in a reply
Post Reply