Vulkan 在 Linux 上因 BadLength 而失败(poly 请求过大或内部 Xlib 长度错误)

Vulkan 在 Linux 上因 BadLength 而失败(poly 请求过大或内部 Xlib 长度错误)

基于 Vulkan 的任何东西在启动时都会失败。系统是 Arch Linux,带有 X11 和 KDE。Bumblebee (optirun) 与 OpenGL 配合使用,工作正常,不会失败。如果没有 optirun,Vulkan 会失败,因为集成显卡(或驱动程序,mesa)似乎不支持它。使用 optirun 会收到以下结果

$ optirun -vv vulkaninfo
[124888.207097] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[124888.208006] [DEBUG]optirun version 3.2.1 starting...
[124888.208080] [DEBUG]Active configuration:
[124888.208090] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[124888.208106] [DEBUG] X display: :8
[124888.208130] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia:/usr/lib32/nvidia:/usr/lib:/usr/lib32
[124888.208158] [DEBUG] Socket path: /var/run/bumblebee.socket
[124888.208180] [DEBUG] Accel/display bridge: auto
[124888.208194] [DEBUG] VGL Compression: proxy
[124888.208207] [DEBUG] VGLrun extra options: 
[124888.208220] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus
[124888.208375] [DEBUG]Using auto-detected bridge virtualgl
[124889.370796] [INFO]Response: Yes. X is active.

[124889.370808] [INFO]Running application using virtualgl.
[124889.370905] [DEBUG]Process vglrun started, PID 19159.
X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  7 (X_GLXQueryVersion)
  Serial number of failed request:  9
  Current serial number in output stream:  9
[124889.595290] [DEBUG]SIGCHILD received, but wait failed with No child processes
[124889.595308] [DEBUG]Socket closed.
[124889.595321] [DEBUG]Killing all remaining processes.

有关系统的一些信息

$ optirun --version
optirun (Bumblebee) 3.2.1

$ pacaur -Qi vulkan-tools 
Name            : vulkan-tools
Version         : 1.1.114-1

$ pacaur -Qi xorg-server 
Name            : xorg-server
Version         : 1.20.5-2

来自 journalctl 的信息

Aug 11 18:02:34 OrestArch kwin_x11[831]: qt.qpa.xcb: Unhandled client message:  "_NET_CURRENT_DESKTOP"
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54472, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54473, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54474, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54475, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54476, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54477, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54478, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 54479, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Aug 11 18:02:37 OrestArch kwin_x11[831]: qt.qpa.xcb: Unhandled client message:  "_NET_CURRENT_DESKTOP"
Aug 11 18:02:45 OrestArch wpa_supplicant[591]: nl80211: send_and_recv->nl_recvmsgs failed: -33
Aug 11 18:03:13 OrestArch kwin_x11[831]: qt.qpa.xcb: Unhandled client message:  "_NET_CURRENT_DESKTOP"
Aug 11 18:03:14 OrestArch kwin_x11[831]: qt.qpa.xcb: Unhandled client message:  "_NET_CURRENT_DESKTOP"
Aug 11 18:03:17 OrestArch kwin_x11[831]: qt.qpa.xcb: Unhandled client message:  "_NET_CURRENT_DESKTOP"
Aug 11 18:03:51 OrestArch kernel: bbswitch: enabling discrete graphics
Aug 11 18:03:51 OrestArch kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 236
Aug 11 18:03:51 OrestArch kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  430.40  Sun Jul 21 04:53:48 CDT 2019
Aug 11 18:03:52 OrestArch kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  430.40  Sun Jul 21 04:57:42 CDT 2019
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603240] [WARN][XORG] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603253] [WARN][XORG] (WW) Warning, couldn't open module mouse
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603261] [WARN][XORG] (WW) NVIDIA(0): Unable to get display device for DPI computation.
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603265] [WARN][XORG] (WW) NVIDIA(0): Option "NoLogo" is not used
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603272] [WARN][XORG] (WW) Warning, couldn't open module mouse
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603276] [ERROR][XORG] (EE) PreInit returned 2 for "<default pointer>"
Aug 11 18:03:52 OrestArch bumblebeed[571]: [127184.603280] [ERROR][XORG] (EE) PreInit returned 2 for "<default keyboard>"
Aug 11 18:03:52 OrestArch audit[21655]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=2 pid=21655 comm="vulkaninfo" exe="/usr/bin/vulkaninfo" sig=11 res=1
Aug 11 18:03:52 OrestArch kernel: vulkaninfo[21655]: segfault at 10 ip 00007fc63ce62d14 sp 00007ffe39105e58 error 4 in libpthread-2.29.so[7fc63ce5e000+f000]
Aug 11 18:03:52 OrestArch kernel: Code: ff 48 8d 0d 6e a9 00 00 ba 4f 02 00 00 48 8d 35 f7 a7 00 00 48 8d 3d 0d a8 00 00 e8 46 ba ff ff 66 0f 1f 44 00 00 f3 0f 1e fa <8b> 47 10 49 89 f8 89 c2 81 e2 7f 01 00 00 83 e0 7c 0f 85 a5 00 00
Aug 11 18:03:52 OrestArch kernel: audit: type=1701 audit(1565535832.160:209): auid=1000 uid=1000 gid=1000 ses=2 pid=21655 comm="vulkaninfo" exe="/usr/bin/vulkaninfo" sig=11 res=1
Aug 11 18:03:52 OrestArch systemd[1]: Started Process Core Dump (PID 21664/UID 0).
-- Subject: A start job for unit [email protected] has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit [email protected] has finished successfully.
-- 
-- The job identifier is 5178.
Aug 11 18:03:52 OrestArch audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-21664-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 11 18:03:52 OrestArch kernel: audit: type=1130 audit(1565535832.166:210): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-21664-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 11 18:03:52 OrestArch systemd-coredump[21665]: Process 21655 (vulkaninfo) of user 1000 dumped core.

                                                   Stack trace of thread 21655:
                                                   #0  0x00007fc63ce62d14 __pthread_mutex_lock (libpthread.so.0)
                                                   #1  0x00007fc63b80e2cc n/a (libnvidia-glcore.so.430.40)
                                                   #2  0x00007fc63c967558 n/a (libGLX_nvidia.so.0)
                                                   #3  0x00007fc63c9621c9 n/a (libGLX_nvidia.so.0)
                                                   #4  0x00007fc63c9633d4 n/a (libGLX_nvidia.so.0)
                                                   #5  0x00007fc63d2363ca XCloseDisplay (libX11.so.6)
                                                   #6  0x00007fc63d3cb034 XCloseDisplay (libvglfaker.so)
                                                   #7  0x00007fc63c983fbf n/a (libGLX_nvidia.so.0)
                                                   #8  0x00007fc63d471b4d _dl_fini (ld-linux-x86-64.so.2)
                                                   #9  0x00007fc63d025e70 __run_exit_handlers (libc.so.6)
                                                   #10 0x00007fc63d025fae exit (libc.so.6)
                                                   #11 0x00007fc63d25b3d8 _XDefaultError (libX11.so.6)
                                                   #12 0x00007fc63d25b50a _XError (libX11.so.6)
                                                   #13 0x00007fc63d258398 n/a (libX11.so.6)
                                                   #14 0x00007fc63d259596 _XReply (libX11.so.6)
                                                   #15 0x00007fc63c960d92 n/a (libGLX_nvidia.so.0)
                                                   #16 0x00007fc63c98404a n/a (libGLX_nvidia.so.0)
                                                   #17 0x00007fc63c9843c9 vk_icdNegotiateLoaderICDInterfaceVersion (libGLX_nvidia.so.0)
                                                   #18 0x00007fc63d1d8216 n/a (libvulkan.so.1)
                                                   #19 0x00007fc63d1dce68 n/a (libvulkan.so.1)
                                                   #20 0x00007fc63d1de85e vkEnumerateInstanceExtensionProperties (libvulkan.so.1)
                                                   #21 0x000056501afa4736 n/a (vulkaninfo)
                                                   #22 0x000056501af9e2e7 n/a (vulkaninfo)
                                                   #23 0x00007fc63d00fee3 __libc_start_main (libc.so.6)
                                                   #24 0x000056501afa0f2e n/a (vulkaninfo)

任何帮助都值得感激。提前致谢。

答案1

解决方案是安装最新版本的 Nvidia 驱动程序primus_vk,因为默认情况下 Bumblebee 不支持 Vulkan。

相关内容