Search Unity

Help running app on Linux running under Parallels

Discussion in 'Linux' started by btschumy, Aug 30, 2021.

  1. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    93
    I am not a Linux user but am trying to release a Linux build of my app. To test it I installed Mint 20.2 in a Parallels VM on macOS. I downloaded and unzipped my app into my Linux desktop. Here is what is in the folder.

    parallels@parallels-Parallels-Virtual-Platform:~/Desktop/OurGalaxy_Linux$ ls -l
    total 73072
    -rw-r--r-- 1 parallels parallels 16064 May 23 15:05 LinuxPlayer_s.debug
    drwxr-xr-x 5 parallels parallels 4096 Aug 25 16:58 OurGalaxy_Linux_Data
    -rwxr-xr-x 1 parallels parallels 14744 May 23 15:05 OurGalaxy_Linux.x86_64
    -rw-r--r-- 1 parallels parallels 41300976 May 23 15:05 UnityPlayer_s.debug
    -rw-r--r-- 1 parallels parallels 33482064 May 23 15:05 UnityPlayer.so

    I manually made the OurGalaxy_Linux.x86_64 executable.

    When I run it, a window briefly flashes on screen and then the app exits. Running from a terminal window doesn't provide any useful info.

    parallels@parallels-Parallels-Virtual-Platform:~/Desktop/OurGalaxy_Linux$ ./OurGalaxy_Linux.x86_64
    Set current directory to /home/parallels/Desktop/OurGalaxy_Linux
    Found path: /home/parallels/Desktop/OurGalaxy_Linux/OurGalaxy_Linux.x86_64
    parallels@parallels-Parallels-Virtual-Platform:~/Desktop/OurGalaxy_Linux$

    I did run the Logs app but I don't see anything in the logs that looks relevant. Can someone give me some pointers on how to figure out what the problem is?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  3. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    93
    Thanks for responding. Here is what I see:

    parallels@parallels-Parallels-Virtual-Platform:~/.config/unity3d/Otherwise/Our Galaxy$ cat Player.log
    Mono path[0] = '/home/parallels/Desktop/OurGalaxy_Linux/OurGalaxy_Linux_Data/Managed'
    Mono config path = '/home/parallels/Desktop/OurGalaxy_Linux/OurGalaxy_Linux_Data/MonoBleedingEdge/etc'
    Display 0 'Virtual1': 1772x1064 (primary device).
    Unable to load player prefs
    Desktop is 1772 x 1064 @ 60 Hz
    Unable to find a supported OpenGL core profile
    Failed to create valid graphics context: please ensure you meet the minimum requirements
    E.g. OpenGL core profile 3.2 or later for OpenGL Core renderer
    [Vulkan init] extensions: count=18
    [Vulkan init] extensions: name=VK_KHR_device_group_creation, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_fence_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_memory_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_semaphore_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_get_display_properties2, enabled=0
    [Vulkan init] extensions: name=VK_KHR_get_physical_device_properties2, enabled=1
    [Vulkan init] extensions: name=VK_KHR_get_surface_capabilities2, enabled=0
    [Vulkan init] extensions: name=VK_KHR_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_surface_protected_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_wayland_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_xcb_surface, enabled=0
    [Vulkan init] extensions: name=VK_KHR_xlib_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_display, enabled=1
    [Vulkan init] extensions: name=VK_EXT_direct_mode_display, enabled=0
    [Vulkan init] extensions: name=VK_EXT_acquire_xlib_display, enabled=0
    [Vulkan init] extensions: name=VK_EXT_display_surface_counter, enabled=0
    [Vulkan init] extensions: name=VK_EXT_debug_report, enabled=0
    [Vulkan init] extensions: name=VK_EXT_debug_utils, enabled=0
    Vulkan detection: 0
    No supported renderers found, exiting

    So it seems it can't create a graphics context. Do I need to install OpenGL?
     
  4. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    93
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I'm not sure, but it seems that your VM doesn't support neither OpenGL or Vulkan so Unity fails to run. You'd usually need to install a graphics driver to fix it.
     
  6. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    93
    I use Parallels to run Windows on macOS and it runs fine there. Is it using DirectX there rather than OpenGL?

    ETA: I did just find this: https://kb.parallels.com/124138
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yeah on Windows it uses DirectX.
     
  8. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    93
    OK, I did a few updates that I hoped would help. This time it still doesn't find OpenGL, but it looks like it attempts to use Vulkan. It still fails, but in a different way. Can you tell from the log what is happening?

    parallels@parallels-Parallels-Virtual-Platform:~/.config/unity3d/Otherwise/Our Galaxy$ cat Player.log
    Mono path[0] = '/home/parallels/Desktop/OurGalaxy_Linux/OurGalaxy_Linux_Data/Managed'
    Mono config path = '/home/parallels/Desktop/OurGalaxy_Linux/OurGalaxy_Linux_Data/MonoBleedingEdge/etc'
    Display 0 'Virtual1': 1772x1064 (primary device).
    Unable to load player prefs
    Desktop is 1772 x 1064 @ 60 Hz
    Unable to find a supported OpenGL core profile
    Failed to create valid graphics context: please ensure you meet the minimum requirements
    E.g. OpenGL core profile 3.2 or later for OpenGL Core renderer
    [Vulkan init] extensions: count=18
    [Vulkan init] extensions: name=VK_KHR_device_group_creation, enabled=0
    [Vulkan init] extensions: name=VK_KHR_display, enabled=1
    [Vulkan init] extensions: name=VK_KHR_external_fence_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_memory_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_semaphore_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_get_display_properties2, enabled=0
    [Vulkan init] extensions: name=VK_KHR_get_physical_device_properties2, enabled=1
    [Vulkan init] extensions: name=VK_KHR_get_surface_capabilities2, enabled=0
    [Vulkan init] extensions: name=VK_KHR_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_surface_protected_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_wayland_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_xcb_surface, enabled=0
    [Vulkan init] extensions: name=VK_KHR_xlib_surface, enabled=1
    [Vulkan init] extensions: name=VK_EXT_acquire_xlib_display, enabled=0
    [Vulkan init] extensions: name=VK_EXT_debug_report, enabled=0
    [Vulkan init] extensions: name=VK_EXT_direct_mode_display, enabled=0
    [Vulkan init] extensions: name=VK_EXT_display_surface_counter, enabled=0
    [Vulkan init] extensions: name=VK_EXT_debug_utils, enabled=0
    Vulkan detection: 2
    Initialize engine version: 2021.1.9f1 (1d4bac5d6212)
    [Subsystems] Discovering subsystems at path /home/parallels/Desktop/OurGalaxy_Linux/OurGalaxy_Linux_Data/UnitySubsystems
    GfxDevice: creating device client; threaded=1; jobified=1
    Unable to find a supported OpenGL core profile
    Unable to find a supported OpenGL core profile
    GfxDevice: creating device client; threaded=1; jobified=1
    [Vulkan init] extensions: count=18
    [Vulkan init] extensions: name=VK_KHR_device_group_creation, enabled=0
    [Vulkan init] extensions: name=VK_KHR_display, enabled=1
    [Vulkan init] extensions: name=VK_KHR_external_fence_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_memory_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_external_semaphore_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_get_display_properties2, enabled=0
    [Vulkan init] extensions: name=VK_KHR_get_physical_device_properties2, enabled=1
    [Vulkan init] extensions: name=VK_KHR_get_surface_capabilities2, enabled=0
    [Vulkan init] extensions: name=VK_KHR_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_surface_protected_capabilities, enabled=0
    [Vulkan init] extensions: name=VK_KHR_wayland_surface, enabled=1
    [Vulkan init] extensions: name=VK_KHR_xcb_surface, enabled=0
    [Vulkan init] extensions: name=VK_KHR_xlib_surface, enabled=1
    [Vulkan init] extensions: name=VK_EXT_acquire_xlib_display, enabled=0
    [Vulkan init] extensions: name=VK_EXT_debug_report, enabled=0
    [Vulkan init] extensions: name=VK_EXT_direct_mode_display, enabled=0
    [Vulkan init] extensions: name=VK_EXT_display_surface_counter, enabled=0
    [Vulkan init] extensions: name=VK_EXT_debug_utils, enabled=0
    [Vulkan init] SelectPhysicalDevice requestedDeviceIndex=-1 xrDevice=(nil)
    [Vulkan init] Physical Device 0x1911d40 [0]: "llvmpipe (LLVM 12.0.0, 256 bits)" deviceType=4 vendorID=10005 deviceID=0
    [Vulkan init] Selected physical device (nil)
    Caught fatal signal - signo:11 code:1 errno:0 addr:(nil)
    Obtained 12 stack frames.
    #0 0x007fdeaa71e3c0 in funlockfile
    #1 0x007fdea004a514 in vkGetPhysicalDeviceQueueFamilyProperties
    #2 0x007fdeab3e72e1 in vk::Initialize()
    #3 0x007fdeab3f09d9 in CreateVKGfxDevice()
    #4 0x007fdeab36cfbe in CreateClientGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags)
    #5 0x007fdeab84e5bb in CreateGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags)
    #6 0x007fdeab84e921 in InitializeGfxDevice()
    #7 0x007fdeab701452 in InitializeEngineGraphics(bool)
    #8 0x007fdeab71006c in PlayerInitEngineGraphics(bool)
    #9 0x007fdeab8eec19 in PlayerMain(int, char**)
    #10 0x007fdeaa53e0b3 in __libc_start_main
    #11 0x00000000201029 in _start
    parallels@parallels-Parallels-Virtual-Platform:~/.config/unity3d/Otherwise/Our Galaxy$
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Looks like it crashes within the Vulkan driver now.
     
  10. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    93
    Yes, I can see that. The question is whether there is anything I can do about it? Is there anything special I need to do to enable Vulkan support when building the Linux app?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Try looking at the output of "glxinfo" and "vulkaninfo" (they come from "mesa-utils" and "vulkan-utils" packages). Some of my coworkers said they had better luck with 3d graphics on Linux with VMWare Fusion as opposed to Parallels.
     
  12. emi_trackman

    emi_trackman

    Joined:
    Nov 19, 2021
    Posts:
    1
    Was investigating this issue recently, looks like code in Unity engine filters out devices that have deviceType==4 (i.e CPU and not Discrete/Integrated GPU), then it calls vkGetPhysicalDeviceQueueFamilyProperties vulkan API with a null instead of device id, which may be a bug, causing this segmentation fault crash.

    I patched and re-build the llvmpipe (in mesa source code) so it reports different deviceType now and it works fine, here is the corresponding line https://github.com/mesa3d/mesa/blob.../gallium/frontends/lavapipe/lvp_device.c#L999
     
  13. tylerinthezoo

    tylerinthezoo

    Unity Technologies

    Joined:
    Jun 15, 2022
    Posts:
    92
    it feels your GPU driver is not properly installed so vulkan does not detect your gpu. You can check with vulkaninfo and see if the GPU is detected, and you can run inxi -G to see what is the default renderer. If it is llvmpipe, your GPU driver is not installed correctly. glxinfo | grep vendor should give you the same thing.

    if that is the case, gpu drivers need fix first until vulkaninfo shows the correct renderer.
     
    Last edited: Jul 21, 2022
  14. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Has anyone found a solution to this? With Unity being a cross-platform development app, I would think supporting VMs to actually test your cross-platform builds would be a high priority. High enough, for example, that they might supply VM configurations for the two major VM platforms (Parallels and VMWare) that just work out of the box.

    Barring that, step-by-step directions on how one could configure a virtual Linux box for testing would be really helpful. Anyone?