Search Unity

Running on Ubuntu with VMWare Workstation

Discussion in 'Linux' started by Doddler, May 14, 2017.

  1. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    For my project I try to support all 3 main desktop platforms, but because I don't have a linux desktop handy, I've been using a virtual machine decked out with the latest Ubuntu to test on. With unity 5.5 unity unceremoniously yanking OpenGL 2 support however, this seems to no longer works (also caused issues with a number of our users, but that's another story).

    I've gone through the effort to make sure the VM is fully up to date, as well as ensuring the graphics driver properly support OpenGL core profile 3.3. Other OpenGL test apps run correctly, but I seem to be out of luck getting unity games to start.

    Running "glxinfo | grep OpenGL" gives the following relevant results:

    Code (Terminal):
    1. OpenGL vendor string: VMware, Inc.
    2. OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE;  LLVM;
    3. OpenGL core profile version string: 3.3 (Core Profile) Mesa 17.2.0-devel
    4. OpenGL core profile shading language version string: 3.30
    5. OpenGL core profile context flags: (none)
    6. OpenGL core profile profile mask: core profile
    7. OpenGL core profile extensions:
    That looks like it meets the minimum requirements... but when you start the game, you get initially a dark blue screen, and then only black. The game appears to play correctly, as you can still hear audio and interact with the black screen, just no graphics.

    The log displays as one would expect, albeit with some rather incredibly unhelpful but probably relevant error messages. The log file is:

    Code (Log):
    1. Selecting FBConfig
    2. GLX_FBCONFIG_ID=139
    3. GLX_BUFFER_SIZE=32
    4. GLX_DOUBLEBUFFER=1
    5. GLX_RED_SIZE=8
    6. GLX_GREEN_SIZE=8
    7. GLX_BLUE_SIZE=8
    8. GLX_ALPHA_SIZE=8
    9. GLX_DEPTH_SIZE=24
    10. GLX_STENCIL_SIZE=8
    11. GLX_SAMPLES_ARB=0
    12. GLX_SAMPLE_BUFFERS_ARB=0
    13. GLX_STEREO=0
    14. GLX_CONFIG_CAVEAT=NONE
    15.  
    16. Desktop is 1801 x 1222 @ 60 Hz
    17. XError: GLXBadFBConfig (error 178, opcode 155/34, serial 52, XID 03c00002, display 0x4199dd0
    18. XError: GLXBadFBConfig (error 178, opcode 155/34, serial 55, XID 03c00002, display 0x4199dd0
    19. XError: GLXBadFBConfig (error 178, opcode 155/34, serial 58, XID 03c00002, display 0x4199dd0
    20. XError: GLXBadFBConfig (error 178, opcode 155/34, serial 61, XID 03c00002, display 0x4199dd0
    21. XError: GLXBadFBConfig (error 178, opcode 155/34, serial 64, XID 03c00002, display 0x4199dd0
    22. XError: GLXBadFBConfig (error 178, opcode 155/34, serial 67, XID 03c00002, display 0x4199dd0
    23. Initialize engine version: 5.5.3p3 (3ff9bc5a03ff)
    24. Forcing GfxDevice: OpenGL Core
    25. GfxDevice: creating device client; threaded=0
    26. GLX Extensions: GLX_ARB_create_context GLX_ARB_create_context_profile GLX_ARB_fbconfig_float GLX_ARB_framebuffer_sRGB GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_fbconfig_packed_float GLX_EXT_framebuffer_sRGB GLX_EXT_create_context_es2_profile GLX_EXT_create_context_es_profile GLX_MESA_copy_sub_buffer GLX_MESA_multithread_makecurrent GLX_MESA_query_renderer GLX_MESA_swap_control GLX_OML_swap_method GLX_SGI_make_current_read GLX_SGI_video_sync GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap
    27. Setting maxVSyncInterval to 0
    28. Renderer: Gallium 0.4 on SVGA3D; build: RELEASE;  LLVM;
    29. Vendor:   VMware, Inc.
    30. Version:  3.3 (Core Profile) Mesa 17.2.0-devel
    31. GLES:     0
    32.  GL_AMD_conservative_depth GL_AMD_shader_trinary_minmax GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_blend_func_extended GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_occlusion_query2 GL_
    33. ARB_pixel_buffer_object GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robustness GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_sync GL_ARB_texture_buffer_object GL_ARB_texture_compression_rgtc GL_ARB_texture_float GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_binding GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ATI_blend_equation_separate GL_ATI_texture_float GL_EXT_abgr GL_EXT_blend_equation_separate GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_fra
    34. mebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_sRGB GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_pixel_buffer_object GL_EXT_provoking_vertex GL_EXT_shader_integer_mix GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_IBM_multimode_draw_arrays GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error GL_MESA_pack_invert GL_MESA_shader_integer_functions GL_MESA_texture_signed_rgba GL_NV_conditional_render GL_NV_depth_clamp GL_NV_packed_depth_stencil GL_OES_EGL_image GL_S3_s3tc
    35. OPENGL LOG: Creating OpenGL 3.3 graphics device ; Context level  <OpenGL 3.3> ; Context handle 68907200
    36. AudioManager: Using PulseAudio: Default Output Device
    37. Begin MonoManager ReloadAssembly
    38. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.dll (this message is harmless)
    39. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.dll into Unity Child Domain
    40. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/Assembly-CSharp-firstpass.dll (this message is harmless)
    41. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/Assembly-CSharp-firstpass.dll into Unity Child Domain
    42. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/Assembly-CSharp.dll (this message is harmless)
    43. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/Assembly-CSharp.dll into Unity Child Domain
    44. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.UI.dll (this message is harmless)
    45. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.UI.dll into Unity Child Domain
    46. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.Networking.dll (this message is harmless)
    47. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.Networking.dll into Unity Child Domain
    48. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.PlaymodeTestsRunner.dll (this message is harmless)
    49. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.PlaymodeTestsRunner.dll into Unity Child Domain
    50. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.Analytics.dll (this message is harmless)
    51. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/UnityEngine.Analytics.dll into Unity Child Domain
    52. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/GameDataSerializer.dll (this message is harmless)
    53. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/GameDataSerializer.dll into Unity Child Domain
    54. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/GameDataTypes.dll (this message is harmless)
    55. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/GameDataTypes.dll into Unity Child Domain
    56. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/protobuf-net.dll (this message is harmless)
    57. Loading /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/protobuf-net.dll into Unity Child Domain
    58. - Completed reload, in  0.129 seconds
    59. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/System.Core.dll (this message is harmless)
    60. Platform assembly: /home/doddler/Desktop/Da Capo 3/DC3_Data/Managed/System.dll (this message is harmless)
    61. Default vsync count 0
    62. requesting resize 1024 x 576
    63. resizing window to 1024 x 576
    64. Desktop is 1801 x 1222 @ 60 Hz
    65. Using libudev for joystick management

    Has anyone managed to get this working? I don't currently have the separate hardware to get a linux install that can run unity, and this used to work fine before support for OpenGL 2 was dropped. Sadly at this point rolling back to pre-5.5 isn't an option anymore...
     
  2. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    This seems to be an issue in the vmware accelerated drivers.
    If you turn off hardware acceleration in your VM (and have a guest driver supporting OpenGL 3.2+ core profile), you should be able to get correct rendering, albeit with the performance you might expect.
     
  3. Doddler

    Doddler

    Joined:
    Jul 12, 2011
    Posts:
    269
    Thanks for the tip! I had expected disabling acceleration would result in something completely unusable, but for simple 2d games like what I have, it seems to be enough to test with. Would be best I guess if the drivers could be fixed, but I guess this works for now.
     
  4. whiskers434

    whiskers434

    Joined:
    Sep 23, 2014
    Posts:
    28
    Thanks this fixed my issue, is there a fix or other work around for this to allow hardware acceleration without blackscreen?
     
  5. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Well, the vmware driver needs to be fixed. :)
     
  6. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I can confirm this is still a problem under VMware Workstation Pro version 14.0, and that the workaround of turning off hardware acceleration in the VM configuration works. The performance is hideously slow, though. I have a 4.7 GHz quad core CPU and a GTX 1080 GPU here, and with an extremely simple scene (a plane and three capsules plus an explore camera and a single directional light), I'm getting about 3 or 4 FPS. It "works", for sufficiently small values of the variable "works". :)
     
  7. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Actually, with VMware 14 and Ubuntu 17.10, it's working here with acceleration enabled.
    (Host GPU is Nvidia GTX980M, Host OS is also Ubuntu 17.10 ;) )

    I've also had reports that it works with the corresponding version of VMware Fusion.
     
    syscrusher likes this.
  8. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    That's fantastic news! I don't have an Ubuntu 17 virtual machine yet, but I'll make one here and give it a try!

    My wife has a System76 laptop booting Linux natively, but I also can't run Unity *there* because of an OpenGL stack bug with the Nvidia driver. (Known and documented, and a workaround exists, but installing the workaround will be disruptive and I haven't had time to do it for her yet.)

    I'll post back to this thread after I try my app in Ubuntu 17.10.
     
  9. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I haven't tested on Fusion, but I can now confirm that it works on Workstation 14, Ubuntu 17.10, and acceleration enabled. FWIW, I'm also running on a 4K screen, and there were no problems in that regard. I am running the VMware Tools package from VMware Inc., and not the default open-vm-tools package from Ubuntu, because the VMware version is needed for shared folders to work correctly.

    I'm not getting mouse input events in my Unity app, but I'll investigate that separately. Keyboard input is working, so this is probably my project settings rather than an issue with the environment.

    @Tak, you are my hero today for letting me know that the Linux version bump was worth trying.
     
  10. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    One additional bit of information that I've found: Realtime directional lighting is ignored unless you disable shadows from the light sources, at least in my environment (Unity 2017.2.0f3, Ubuntu 17.10 x64, and VMware Workstation 14.0 on a Windows 64-bit host). Realtime GI is working for me.

    This is not a problem for my PoC project, which doesn't need ultra graphics, but I thought it worth mentioning in case others encounter the issue. I suspect it's an artifact of running in VMware, and it probably isn't repeatable on a physical Linux host, but I don't have a test bed to try it yet.

    Also, I resolved the input event problem. As I suspected, it was my project settings.