Ubuntu 18.04 "Failed to initialize Unity graphics"

I’m trying to run Unity on a remote Ubuntu 18.04 machine, running xfce4, via VNC. xfce4 works, VNC works, ssh shell works. The machine has an Nvidia Tesla T4. I installed the latest Nvidia drivers and Cuda 11.4. When I launch Unity, I see the Unity splash screen, but then I get “Failed to initialize Unity graphics” (link below)

https://ibb.co/Zfq13H6

The message doesn’t tell me specifically what’s wrong. Do I need to run some other GUI (gnome) instead of xfce4? Is there a minimum screen resolution requirement?

Try looking at the log files: Unity - Manual: Log files

Thanks. The Editor log doesn’t tell me SPECIFICALLY what’s wrong, it complains about graphics drivers and requirements in general.


No matching FBConfig found
GLX Extensions: GLX_ARB_get_proc_address GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_buffer_age GLX_NV_copy_image GLX_NV_copy_buffer
No matching FBConfig found
GLX Extensions: GLX_ARB_get_proc_address GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_buffer_age GLX_NV_copy_image GLX_NV_copy_buffer
GfxDevice: creating device client; threaded=1; jobified=0
[vulkan] LoadVulkanLibrary libvulkan.so.1[vulkan] LoadVulkanLibrary failed to load libvulkan.so.1Vulkan detection: 0
No matching FBConfig found
GLX Extensions: GLX_ARB_get_proc_address GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_buffer_age GLX_NV_copy_image GLX_NV_copy_buffer
No matching FBConfig found
GLX Extensions: GLX_ARB_get_proc_address GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_buffer_age GLX_NV_copy_image GLX_NV_copy_buffer
No matching FBConfig found
GLX Extensions: GLX_ARB_get_proc_address GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_buffer_age GLX_NV_copy_image GLX_NV_copy_buffer
No matching FBConfig found
GLX Extensions: GLX_ARB_get_proc_address GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_buffer_age GLX_NV_copy_image GLX_NV_copy_buffer
Failed to initialize unity graphics.
Please make sure that your graphics card drivers are installed/up to date and that it meets the minimum requirements listed in our website.
Gtk-Message: 18:15:30.609: GtkDialog mapped without a transient parent. This is discouraged.
Unable to find method OpenProject in [UnityEditor.CoreModule.dll]Unity.CodeEditor.CodeEditor
Unable to find method RequiresCoreStatsInBuild in [UnityEditor.CoreModule.dll]UnityEditor.Analytics.AnalyticsSettings
Unable to find type [UnityEditor.CoreModule.dll]UnityEditor.AnimationClipSettings


When I run nvidia-smi, it tells me the Nvidia driver installed OK

~$ nvidia-smi
Fri Sep 24 07:40:13 2021
±----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 On | 00000000:00:04.0 Off | 0 |
| N/A 36C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+


I found a thread where the poster advises to use the “cinnamon” GUI, because it has some “fallback” software rendering mode. I’ll try to replace my xfce4 GUI with “cinnamon”

Looks like on Cinnamon, Unity gets past the “graphics driver” issues, I see the “Importing…” part of the project, but Unity still crashes. Based on what I see at the end of the Editor log, It has something to do with the VNC’s RGB depth / resolution. I’ll investigate.


$ cat ~/.config/unity3d/Editor.log

Native stacktrace:

/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Data/MonoBleedingEdge/MonoEmbedRuntime/libmonobdwgc-2.0.so(+0xd80ac) [0x7ff7389530ac]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Data/MonoBleedingEdge/MonoEmbedRuntime/libmonobdwgc-2.0.so(+0x5be51) [0x7ff7388d6e51]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7ff897289980]
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0(+0xa7465) [0x7ff76bb1b465]
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0(+0x8a430) [0x7ff76bafe430]
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.57.02(+0xdbeb98) [0x7ff76a2dab98]
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0(+0x50072) [0x7ff76bac4072]
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.57.02(+0x1175c51) [0x7ff76a691c51]
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.57.02(+0x1176158) [0x7ff76a692158]
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.57.02(+0x1177f03) [0x7ff76a693f03]
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.57.02(+0x116daf3) [0x7ff76a689af3]
/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.470.57.02(+0x1177a1f) [0x7ff76a693a1f]
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0(+0xa528f) [0x7ff76bb1928f]
/usr/lib/x86_64-linux-gnu/libvulkan.so.1(+0x2afa4) [0x7ff76bddbfa4]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x2398a1d) [0x56357f359a1d]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x2399a2f) [0x56357f35aa2f]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x239a0f6) [0x56357f35b0f6]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x2371466) [0x56357f332466]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x2371321) [0x56357f332321]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x2357983) [0x56357f318983]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x23575e4) [0x56357f3185e4]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x23670ce) [0x56357f3280ce]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x412e5ad) [0x5635810ef5ad]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x413193f) [0x5635810f293f]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x4131907) [0x5635810f2907]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x41267d6) [0x5635810e77d6]
/mnt/disks/disk2/Unity/2021.1.21f1/Editor/Unity(+0x2955381) [0x56357f916381]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7ff89727e6db]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7ff896fa771f]

Debug info from gdb:

mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb
AcceleratorClientConnectionCallback - disconnected - :0

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

Caught fatal signal - signo:11 code:1 errno:0 addr:0x1c0
Obtained 27 stack frames.
#0 0x007ff897289980 in funlockfile
#1 0x007ff76bb1b465 in vk_icdNegotiateLoaderICDInterfaceVersion
#2 0x007ff76bafe430 in glXCreateGLXPbufferSGIX
#3 0x007ff76a2dab98 in _nv014glcore
#4 0x007ff76bac4072 in (Unknown)
#5 0x007ff76a691c51 in vk_optimusGetDeviceProcAddr
#6 0x007ff76a692158 in vk_optimusGetDeviceProcAddr
#7 0x007ff76a693f03 in vk_optimusGetDeviceProcAddr
#8 0x007ff76a689af3 in vk_optimusGetDeviceProcAddr
#9 0x007ff76a693a1f in vk_optimusGetDeviceProcAddr
#10 0x007ff76bb1928f in __glx_Main
#11 0x007ff76bddbfa4 in vkAcquireNextImage2KHR
#12 0x0056357f359a1d in vk::SwapChain::SetupSwapChain(VkPhysicalDevice_T*, VkDevice_T*, VkSurfaceFormatKHR const&, VkSurfaceKHR_T*, VkExtent2D, VkPresentModeKHR, VkSurfaceCapabilitiesKHR const&, unsigned int&, unsigned int&)
#13 0x0056357f35aa2f in vk::SwapChain::Create(vk::CommandBuffer*)
#14 0x0056357f35b0f6 in vk::SwapChain::UpdateConfiguration(vk::SwapChainConfiguration const&, bool, vk::CommandBuffer*)
#15 0x0056357f332466 in GfxDeviceVK::UpdatePrimarySwapChain(vk::SwapChainConfiguration const&)
#16 0x0056357f332321 in GfxDeviceVK::AdjustPrimarySwapChain(unsigned long, int, int, int, int, int, bool, bool, int, int, bool, DepthBufferFormat, int&, int&, int&)
#17 0x0056357f318983 in VKWindow::Reshape(int, int, DepthBufferFormat, bool)
#18 0x0056357f3185e4 in VKWindow::VKWindow(unsigned long, int, int, DepthBufferFormat, bool)
#19 0x0056357f3280ce in GfxDeviceVK::CreateGfxWindow(unsigned long, int, int, DepthBufferFormat, bool)
#20 0x005635810ef5ad in GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)
#21 0x005635810f293f in GfxDeviceWorker::RunExt(ThreadedStreamBuffer&)
#22 0x005635810f2907 in GfxDeviceWorker::Run()
#23 0x005635810e77d6 in GfxDeviceWorker::RunGfxDeviceWorker(void*)
#24 0x0056357f916381 in Thread::RunThreadWrapper(void*)
#25 0x007ff89727e6db in start_thread
#26 0x007ff896fa771f in clone
Launching bug reporter
qt.qpa.xcb: failed to initialize XRandr
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QObject(0x1e8df50), parent’s thread is QThread(0x17855e0), current thread is Thread(0x19399f0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlagsQSurfaceFormat::FormatOption(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::smile:efaultColorSpace, profile QSurfaceFormat::NoProfile)
Unsupported screen format: depth: 16, bits_per_pixel: 16, red_mask: 3f, blue_mask: f800
Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.

Fixed the pixel depth to 24 (no longer reported at the bottom), but there’s still some issue

Debug info from gdb:

mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb
AcceleratorClientConnectionCallback - disconnected - :0

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

Caught fatal signal - signo:11 code:1 errno:0 addr:0x100
Obtained 17 stack frames.
#0 0x007f4a36a2c980 in funlockfile
#1 0x007f4909e75df3 in vk_optimusGetDeviceProcAddr
#2 0x00557333676141 in vk::SwapChain::SetupSwapChainImages(VkSwapchainKHR_T*, VkSurfaceFormatKHR const&, VkExtent2D, unsigned int)
#3 0x00557333676a8a in vk::SwapChain::Create(vk::CommandBuffer*)
#4 0x005573336770f6 in vk::SwapChain::UpdateConfiguration(vk::SwapChainConfiguration const&, bool, vk::CommandBuffer*)
#5 0x0055733364e466 in GfxDeviceVK::UpdatePrimarySwapChain(vk::SwapChainConfiguration const&)
#6 0x0055733364e321 in GfxDeviceVK::AdjustPrimarySwapChain(unsigned long, int, int, int, int, int, bool, bool, int, int, bool, DepthBufferFormat, int&, int&, int&)
#7 0x00557333634983 in VKWindow::Reshape(int, int, DepthBufferFormat, bool)
#8 0x005573336345e4 in VKWindow::VKWindow(unsigned long, int, int, DepthBufferFormat, bool)
#9 0x005573336440ce in GfxDeviceVK::CreateGfxWindow(unsigned long, int, int, DepthBufferFormat, bool)
#10 0x0055733540b5ad in GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)
#11 0x0055733540e93f in GfxDeviceWorker::RunExt(ThreadedStreamBuffer&)
#12 0x0055733540e907 in GfxDeviceWorker::Run()
#13 0x005573354037d6 in GfxDeviceWorker::RunGfxDeviceWorker(void*)
#14 0x00557333c32381 in Thread::RunThreadWrapper(void*)
#15 0x007f4a36a216db in start_thread
#16 0x007f4a3674a71f in clone
Launching bug reporter
qt.qpa.xcb: failed to initialize XRandr
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QObject(0xa35fc0), parent’s thread is QThread(0x8925e0), current thread is Thread(0xdacd00)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlagsQSurfaceFormat::FormatOption(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::smile:efaultColorSpace, profile QSurfaceFormat::NoProfile)

That sounds like X isn’t cooperating with giving you the right framebuffer :frowning:

Doesn’t VNC work via a framebuffer protocol?

Since VNC works (i.e. I can see the remote desktop), I’d imagine the frambuffer protocol works? Anyway, all the above was attempted on Google Cloud with Nvidia drivers installed by me. I’ll now try on an Amazon EC2 instance, with Nvidia drivers pre-installed, maybe I’ll get further.

Same problems on an Amazon EC2 instance, with preinstalled Nvidia drivers. The Nvidia driver itself seems OK and recent.

nvidia-smi

Fri Sep 24 18:46:54 2021
±----------------------------------------------------------------------------+
| NVIDIA-SMI 450.142.00 Driver Version: 450.142.00 CUDA Version: 11.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 On | 00000000:00:1E.0 Off | 0 |
| N/A 33C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+


When I run glxinfo (from mesa-utils), OpenGL version string seems to be “1.3” ? This seems very old. Isn’t OpenGL 3.0 a minimum requirement for Unity? Not sure how to update OpenGL version

name of display: :1
display: :1 screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
GLX_ARB_context_flush_control, GLX_ARB_create_context,
GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_stereo_tree, GLX_EXT_swap_control,
GLX_EXT_swap_control_tear, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_NV_copy_buffer,
GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer,
GLX_NV_multigpu_context, GLX_NV_multisample_coverage,
GLX_NV_robustness_video_memory_purge, GLX_NV_swap_group,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_swap_control,
GLX_SGI_video_sync
GLX version: 1.2
GLX extensions:
GLX_ARB_get_proc_address, GLX_EXT_import_context, GLX_EXT_visual_info,
GLX_EXT_visual_rating
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.3 Mesa 4.0.4
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3,
GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_lod_bias

7 GLX Visuals
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat

0x025 16 tc 1 16 0 r y . 6 5 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x026 16 tc 1 16 0 r y . 6 5 5 0 . . 0 16 8 16 16 16 0 0 0 None
0x027 16 tc 1 16 0 r y . 6 5 5 8 . . 0 16 8 16 16 16 16 0 0 None
0x028 16 dc 1 16 0 r y . 6 5 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x029 16 dc 1 16 0 r y . 6 5 5 0 . . 0 16 8 16 16 16 0 0 0 None
0x02a 16 dc 1 16 0 r y . 6 5 5 8 . . 0 16 8 16 16 16 16 0 0 None
0x02b 16 dc 1 16 0 r . . 6 5 5 8 . . 0 16 8 16 16 16 16 0 0 None

Yeah, Unity requires OpenGL 3.2 Core Profile.