Search Unity

Built Game Crashes on Launch

Discussion in 'Linux' started by GravityGamesInteractive, Jan 31, 2016.

  1. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    Hello, I recently have been using the Linux version of the editor to work on my game without having to use my other, slower, Windows machine, and so far the editor has worked flawlessly for me. However, I am having issues with running a built game. I was able to get a game compiled no problem, and when I run the game, it gets to the launcher where you set the graphics settings and input. Once I progress past this screen and launch the game, however, it simply crashes. Sometimes I see a window with just the background color for a brief moment before it crashes, and other times it just crashes without a trace. The game runs flawlessly in the editor, and I've tried compiling as a 64-bit executable and a universal executable. Does anyone know how to fix this?
     
  2. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Please do a: inxi -Fxz
    and post the results.
     
  3. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    I got the following:
    I'm going to see if installing it works, and edit with the result.

    EDIT: Nope. Here's the result, I feel stupid, didn't realize inxi was a diagnostic program.
     
  4. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I see you have Mesa, now, I am going to put up a BIG disclaimer right now. I am NOT an expert. There are people here far more qualified than me, so if you do this, it's on you.

    But what if you used OpenGL, before that however, do this: glxinfo | grep OpenGL
    and post the result. I am not 100% sure, but it might be a videocard/OpenGL issue.
     
  5. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    Well, here's the result:
    So, if I understand correctly from your response, either the editor or the compiled game is not set to use OpenGL. I had assumed this was done by default, but if it's not, how would I change this?
     
  6. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    It's using what just printed out there, for reference, here is mine:

    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: GeForce GTX 770/PCIe/SSE2
    OpenGL core profile version string: 4.3.0 NVIDIA 352.63
    OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler
    OpenGL core profile context flags: (none)
    OpenGL core profile profile mask: core profile
    OpenGL core profile extensions:
    OpenGL version string: 4.5.0 NVIDIA 352.63
    OpenGL shading language version string: 4.50 NVIDIA
    OpenGL context flags: (none)
    OpenGL profile mask: (none)
    OpenGL extensions:

    Are you using the non-free recommended driver for your video card? Again, I am new to Unity on Linux, so I am just guessing trying to help you along.
     
  7. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    As an example (take note I am on Linux Mint), here is the driver I had to select to get things working, I am not sure about your Intel chipset, but I suspect a similar problem:

    Edit: I also forgot to ask, are you using the latest 5.3.1f1?

    Screenshot_2016-01-30_23-51-46.png
     
  8. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    Oh, I actually updated the video card drivers last night (wasn't under the proprietary drivers tab, I had to go to Intel's website manually), so I don't think it's that. Also, I am using the latest Unity build, in case it helps.
     
  9. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Well crap. What if you run a: glmark2
    You will probably need to fetch it, but it is small.
     
  10. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Output should look something like this on the screen.
    Screenshot_2016-01-31_00-14-40.png
     
  11. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    Installed and ran, gave me a rotating, textureless 3D horse, so I think my OpenGL is working.

    EDIT (after seeing updated post): Yep, that's exactly what I got.
     
  12. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Welp, so it's not your videocard, and it's not your OpenGL. I hate to ask a basic question, but did you try removing the Unity install folder, and then sudo reinstalling? I am really clawing for answers.
     
  13. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    I might try that in a bit. I did, however, just try running a Windows export in Wine. I honestly was not expecting it to work, but it seemed to run almost flawlessly under Wine (which is not my typical experience with Unity games in Wine). I really, really hope this isn't a problem on Unity's end, or at the very least is something only in the Linux editor that could be worked around with using my Windows machine for compiling.
     
  14. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    When you run build&run, it isn't working. What if you just build, and then manually navigate to the folder and run it? Basically, instead of Unity kicking off the process, you do.
     
  15. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    I've tried executing both through build and navigating to the folder and build & run. It doesn't work either way.

    EDIT: I'm attempting reinstall now, and will let it progress while I sleep. I'll post again with the results in the morning.

    EDIT 2: ...or not. Reinstalling was really quick because I still had the installer in my Downloads folder. The export still did not work.
     
    Last edited: Jan 31, 2016
  16. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Alright, I am going to build a working small test, and I want you to try and run it and see if it works, give me a minute.
     
  17. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
  18. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    Attempting to run the Hello World you sent crashed in the same way as my project. I hope that means it's on my end.
     
  19. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Alright, so good news is this rules out Unity.
     
  20. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
  21. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    It briefly flashed up on screen before disappearing.
     
  22. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I am at a loss. There is one thing you could test, though I suspect the results. Do a headless build, and see if the process continues running in the task manager.
     
  23. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    The headless build, at least as far as I could tell, was in fact running in the background. When I opened it up, a process with the first word in the title of my game appeared in the task manager, and two instances appeared when I tried opening it again.
     
  24. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Alright, so whatever it is, we can determine:

    1. This problem is not related to Unity directely.
    2. It is definitely related to your graphics card/drivers/OpenGL.

    I can only assume since OpenGL ran earlier, you need to force the Unity game to run with OpenGL. Since you are using an Intel chipset, I have no idea what version of OpenGL you should be using. I am just digging for answers at this point, but that's what I would be looking at. I am not sure, but if there are options in the build settings to disable all fancy effects, like shaders, lighting, ect. You could give that a try.
     
    Last edited: Jan 31, 2016
  25. SergeantG

    SergeantG

    Joined:
    Sep 12, 2015
    Posts:
    32
    Try starting game from terminal with one of this options:
    1. For old backend ( OpenGL 2.1 ): -force-opengl
    2. For new backend/automatic choice: -force-glcore
    3. For specific version of OpenGL try: -force-glcoreXY where XY is one of 32, 33, 40, 41, 42, 43, 44 or 45
    I don't know if it will help, but it changed game behaviour for me.
     
  26. GravityGamesInteractive

    GravityGamesInteractive

    Joined:
    Apr 5, 2014
    Posts:
    13
    Thank you! Running the game with -force-opengl worked! I'll try using -force-glcore as well and see if I get any results.

    EDIT: Using -force-glcore also works! I wonder why it wasn't working without these console commands...
     
  27. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    It likely isn't automatically using OpenGL. You need to set it as your default, but again, I am not sure how you do that with an Intel chipset. Good call SergeantG.
     
  28. Daxiongmao87

    Daxiongmao87

    Joined:
    Jan 7, 2010
    Posts:
    148
    I'm actually on the exact same boat as Gravity here. Works only if I use -force-opengl.

     
  29. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Same problem, and it's Mesa/Intel. What OS, flavour, and version?
     
  30. SergeantG

    SergeantG

    Joined:
    Sep 12, 2015
    Posts:
    32
    For those of You that use Intel GPU, please try this ppa for newest drivers ( x + mesa ):
    https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    PPA supported *buntu versions:
    - 14.04 (trusty) <- only 14.04 and 14.04.1 are supported. 14.04.2 and later are not supported
    - 15.04 (vivid)
    - 15.10 (wily) <- recommended for this PPA
    - 16.04 (xenial)
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    For safety reasons install ppa-purge from repositories too, so if anything goes wrong You will be able to log into console & remove ppa:
    Code (CSharp):
    1. sudo ppa-purge ppa:oibaf/graphics-drivers
    restoring default/system drivers.

    EDIT:
    Now I see that Daxiongmao87 has this ppa enabled & it doesn't help.
     
    Last edited: Feb 1, 2016
  31. Daxiongmao87

    Daxiongmao87

    Joined:
    Jan 7, 2010
    Posts:
    148
    Ubuntu Mate Wily Werewolf (15.10)
     
  32. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Ubuntu Unity 15.10 (NOTE: My system uses XFCE by default, not the Unity DE as it normally is on my version)

    I have this bug too, and forcing the GL flags worked. :) One more note too is that it must be affecting all the Intel cards, as mine's much older than the OP's card. (a Sandy Bridge Intel HD 3000 to be exact)

    Also... good to see I'm not the only one with the issue. :)
     
  33. MJDSys

    MJDSys

    Joined:
    Feb 11, 2016
    Posts:
    1
    I think I tracked this down, and its a Unity bug. By default they request a default context. On Mesa, this returns a 3.0 context. However, they ignore the returned context version and immediately try to use it as a least a 3.3 context, which promptly falls over. If you trace the OpenGL calls, you can see it try to compile a GLSL 1.5 shader.

    Forcing the game to use either an older context or core context ensures Unity gets a context with a version it expects, which it will use correctly. I've seen this on two different Unity projects compiled with newer Unity versions.

    You don't see this on the vendor drivers as they return compatible contexts by default that work up to at least 4.0.
     
  34. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Damn son, good catch! (@Aras, @Tak, @natosha.bard, come look!)
    I also thought...
    what if...
    The vendor drivers DON'T have GL 3.3?

    It happen to those as well if you think about it. And dammit, I wrote a Haiku... :D
     
  35. tomhog

    tomhog

    Joined:
    Dec 22, 2012
    Posts:
    36
    Big thanks for the --force-opengl tip, my app stopped working on a ubuntu virtual machine when I built with unity 5.3.1, a 64 bit version worked fine on a proper machine but my 32bit virtual machine would just close same as posts above.

    Also if it helps anyone I had messed with the graphics apis for Linux in the player settings and had left OpenGL2 off the list, I had to re add it before the force-opengl would work
     
  36. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Make sense, since GLCore's supposed to replace it anyway... :D
     
  37. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    389
    I have this crash on anything I do when I run anything on higher setting excellent ect. However yesterday I downloaded the Viking village demo, this runs on any setting even "berserk" so I'm totally baffled. I also downloaded the Pbr materials demo "paint pot one" and this like my exes crashes on higher quality setting. I've tried all the OpenGL switches. Why would all my simple exes and most demos crash on higher quality and something as complex as Viking village work? There must be a reason
     
  38. Grosama

    Grosama

    Joined:
    Oct 5, 2015
    Posts:
    10
    Hi guys,

    I got the same issue for few days.
    So I installed Unity on a fresh new installed Ubuntu.
    I'm on an AMD card (HD6850).

    - I tested a build with the default xorg driver and it worked like a charm.
    - I installed fglrx then I test the same build and it crashed at launch (just after the resolution settings).
    - I switched back to xorg and purge fglrx. Then i re-installed libgl1-mesa-glx and it works like a charm again.

    The funny thing is if I build from the Unity Windows (on Windows), it works with the fglrx driver. But it doesn't work if I build directly from Unity Linux.

    EDIT : The build runs normaly with the fglrx driver if I do the -force-opengl in the terminal.

    (sorry for my english)
     
  39. SergeantG

    SergeantG

    Joined:
    Sep 12, 2015
    Posts:
    32
    Maybe when exporting from Windows to Linux, editor is setting -force-opengl or it's using old pipeline by default.
     
  40. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    389
    I'm also using fglrx with AMD and it seems to be dependant on the graphics quality, if I turn down the quality after I set resolution it works fine ( with the exception of the Viking village that works on any :s ). I think it has something to do with AMD drivers, no opengl switches work for me.
    Another thing twice on updating unity I've had to do a full purge and reinstall of graphics drives ( black screen issue ), I don't even know how this can happen...
     
  41. adamj93

    adamj93

    Joined:
    Feb 5, 2016
    Posts:
    6
    Thought I'd mention that I have this issue too and appending -force-openGL fixes it for me. I hope this gets fixed though, it's no good if I can't deploy the game! I have a Windows partition that I can use for that, but I want to be able to do everything from Ubuntu.

    EDIT: By the way, when I force OpenGL it does NOT show me the window for resolution and graphics quality. Not sure why this is, but I'd like that to still be there too.
     
    Last edited: Feb 26, 2016
  42. ruberboy

    ruberboy

    Joined:
    Feb 15, 2016
    Posts:
    7
    For me the only way to start a compiled application is using the -force-opengl command. And actually I am grateful because my computer is old, and the graphics card is only 512 mb. High quality settings and PBR may require a recent graphics card even if using the command.
     
  43. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    I was using 5.1.2 to build a Linux version of my game. Worked fine for three months so I added Linux to my Steam store..... upgraded to Unity 5.3.2 and 5.3.3 and have had ubuntu users not be able to open my game anymore. I tried the -force-opengl but it didnt work. Doesnt even save a crash file.... I thought it was something to do with the new multimonitor support.

    I noticed the compiled version did not have .86 as an "extension" anymore. (unity 5.1.2 would save my game as RCSIM2.x86 and now with 5.3.2/3 it only says RCSIM2)

    Any advice?

    For now I have fallen back to 5.1.2 for the linux builds but its a MAJOR pain to use two different editors.

    Kevin
     
  44. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Same type of issue when running Ubuntu Mate 16.04 alpha 2 release and I had crashes running my build also until I updated my openGL drivers. My openGL drivers were 3.0 (via mesa) and the requirement was for OpenGL 3.2 based on the crash log. So basically I had to update from the default Ubuntu (Mesa) drivers to the native Nvidia drivers to solve the issue. The force opengl command-line options did not work for me.

    Does their log file: ~/.config/unity3d/CompanyName/ProductName/Player.log provide anything at all? Or does it dump core files for your users?
     
  45. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    I'm also facing problems with my game on Linux!

    My builds does not works anymore with error "libXcursor.so.1" cannot open shared object file.

    It was working on previous Unity versions.

    Anybody have an advice?
     
    Last edited: Mar 1, 2016
  46. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
  47. Philip-Rowlands

    Philip-Rowlands

    Joined:
    May 13, 2013
    Posts:
    353
    I just came across this myself, at least on both beautiful and fantastic quality settings. Like @knobby67, I'm using the fglrx-updates driver on an AMD graphics card. Disabling antialiasing in the quality settings and rebuilding solved it.

    For what it's worth, here's what the glxinfo | grep OpenGL command gave me:
    Code (csharp):
    1.  
    2. OpenGL vendor string: Advanced Micro Devices, Inc.
    3. OpenGL renderer string: AMD Radeon R7 200 Series
    4. OpenGL core profile version string: 4.3.13399 Core Profile Context 15.201.1151
    5. OpenGL core profile shading language version string: 4.40
    6. OpenGL core profile context flags: (none)
    7. OpenGL core profile profile mask: core profile
    8. OpenGL core profile extensions:
    9. OpenGL version string: 4.5.13399 Compatibility Profile Context 15.201.1151
    10. OpenGL shading language version string: 4.40
    11. OpenGL context flags: (none)
    12. OpenGL profile mask: compatibility profile
    13. OpenGL extensions:
    14.  
     
    knobby67 likes this.
  48. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    389
    @phillip Rowlands, Hi I don't mean to sound stupid but how do I turn the AA off? I can see in radeon control centre I have in 3d two AA settings Anti-Aliasing and Anti-Alisaing mode, these each have "profile" "current system settings" which I don't appear to be able to change this? There's a "override application setting" tick box and a level slider and a filter "standard" combo box.
    AA Mode just has current system settings as above and a slider Multi-sample AA with a slider with preformance, but no turn off ?
     
  49. Philip-Rowlands

    Philip-Rowlands

    Joined:
    May 13, 2013
    Posts:
    353
    I actually disabled that from the quality settings inside Unity, which off the top of my head is under Edit --> Project Settings --> Quality (I'm at work at the moment, but I'll check when I get home). There should be a dropdown menu allowing you to vary the AA for each quality level - by default, Beautiful is set to use 2x filtering, and Fantastic uses 4x. Good doesn't any by default.
     
  50. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    389
    @phillip Rowlands, Thanks it! Thanks. So for some reason AMD and Unity AA don't play well together. I think the forum mods need to put stickies at the top of this form, as most of the issues are down to a few issues each with 2-3 answers.