Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Linux standalone crashes instantly, Virtual Machine, Vulkan, OpenGL

Discussion in 'Linux' started by jonusv, Mar 10, 2021.

  1. jonusv

    jonusv

    Joined:
    Mar 10, 2021
    Posts:
    4
    hi everyone,

    i built a scene with Unity 2019.4.21f1 on Win10 for Linux x86_64 with LZ4HC. When executing the resulting .so file in an Linux 20.04LTS Virtual Machine, a black window opens with the according scene title. However it disappares after less then a second. The newest Vulkan API is installed on the VM.

    Is there the possibility to log the console output of the window so that possible missing dependencies can be seen? Any other solution is appreciated.

    kind regards
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,457
  3. jonusv

    jonusv

    Joined:
    Mar 10, 2021
    Posts:
    4
    Thanks, that was usefull, the file i found is the playerfile.log attached to the post.
    However, it says there is no OpenGL core profile. OpenGL is installed on the VM to the best of my knowledge.

    That is what glxinfo | grep "OpenGL version" says:
    OpenGL version string: 2.1 Mesa 20.2.6

    I found this with a similar log file, where no solution is proposed
    https://forum.unity.com/threads/linux-build-cannot-find-opengl.805239/

    Is the standalone linux unity application to be placed at a special place or can i refere to OpenGL in the Unity BuildSettings?
     

    Attached Files:

  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,457
    The complete quote is:

    Code (csharp):
    1. Unable to find a supported OpenGL core profile
    2. Failed to create valid graphics context: please ensure you meet the minimum requirements
    3. E.g. OpenGL core profile 3.2 or later for OpenGL Core renderer
    Unity requires OpenGL Core Profile 3.2, while your VM seems to only support 2.1.

    And then it tries to fallback to Vulkan:

    Code (csharp):
    1. [Vulkan init] extensions: count=18
    2. [Vulkan init] extensions: name=VK_KHR_device_group_creation, enabled=0
    3. [Vulkan init] extensions: name=VK_KHR_external_fence_capabilities, enabled=0
    4. [Vulkan init] extensions: name=VK_KHR_external_memory_capabilities, enabled=0
    5. [Vulkan init] extensions: name=VK_KHR_external_semaphore_capabilities, enabled=0
    6. [Vulkan init] extensions: name=VK_KHR_get_display_properties2, enabled=0
    7. [Vulkan init] extensions: name=VK_KHR_get_physical_device_properties2, enabled=0
    8. [Vulkan init] extensions: name=VK_KHR_get_surface_capabilities2, enabled=0
    9. [Vulkan init] extensions: name=VK_KHR_surface, enabled=1
    10. [Vulkan init] extensions: name=VK_KHR_surface_protected_capabilities, enabled=0
    11. [Vulkan init] extensions: name=VK_KHR_wayland_surface, enabled=1
    12. [Vulkan init] extensions: name=VK_KHR_xcb_surface, enabled=0
    13. [Vulkan init] extensions: name=VK_KHR_xlib_surface, enabled=1
    14. [Vulkan init] extensions: name=VK_KHR_display, enabled=1
    15. [Vulkan init] extensions: name=VK_EXT_direct_mode_display, enabled=0
    16. [Vulkan init] extensions: name=VK_EXT_acquire_xlib_display, enabled=0
    17. [Vulkan init] extensions: name=VK_EXT_display_surface_counter, enabled=0
    18. [Vulkan init] extensions: name=VK_EXT_debug_report, enabled=0
    19. [Vulkan init] extensions: name=VK_EXT_debug_utils, enabled=0
    20. Vulkan detection: 0
    The error message is less clear here, but it really means that either Unity failed to create a vkInstance, or that vkEnumeratePhysicalDevices returned no available rendering devices.
     
  5. jonusv

    jonusv

    Joined:
    Mar 10, 2021
    Posts:
    4
    As i didnt find any solution to upgrade OpenGL in VirtualBox, i run Linux 20.04LTS with VMware 16 Player.

    OpenGL version string: 4.1 (Compatibility Profile) Mesa 20.2.6


    The OpenGL coreprofile doesnt seems to be the issue here but Vulkan:

    VULKAN DEBUG: ERROR:  [Loader Message, 0]: setupLoaderTermPhysDevs:  Failed to detect any valid GPUs in the current config


    Is it even possible to run a Unity standalone scene in a virtual machine with the GPU abstraction that takes place i.e. the driver of the VM that access the host GPU driver?
     

    Attached Files:

  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,457
    So does OpenGL work?

    It should be, as long as the VM driver implements the graphics API fully. To be clear, this in the VM's ballpark, not Unity's. Unity doesn't try to detect or block you from running on a VM.
     
  7. jonusv

    jonusv

    Joined:
    Mar 10, 2021
    Posts:
    4
    The scene can be rendered using OpenGL 4.1 that comes with VMWare Player 16.1.0. The Vulkan API in the VM can't find any physical devices so that is not working, but as you stated, thats not a Unity issue.

    In my build settings, "player settings", "player", "other settings", "auto graphics API for Linux" was not ticked and Vulkan was listed as the first API, so Unity tried Vulkan and not OpenGL.

    Enabling "auto graphics API for Linux" and using VMWare solved the issue. Thanks so much for the support.
     
unityunity