Linux工作站

Linux工作站

經過大量研究後,向同事提出這個問題。他想透過ssh -X(或)連接到舊的 Centos 4 伺服器-Y並在那裡運行一些 X 應用程式。它過去運作良好多年,但最近對他的客戶端 PC 的更新(在 Centos 7 和 Ubuntu 上)現在使這變得不可能。他的應用程式掛起,並且嘗試簡單地運行glxgears會導致崩潰:

X Error of failed request:  BadValue (integer parameter out of range for operation)
Major opcode of failed request:  150 (GLX)
Minor opcode of failed request:  3 (X_GLXCreateContext)
Value in failed request:  0x0
Serial number of failed request:  19
Current serial number in output stream:  21

確實是客戶端版本問題。在客戶端恢復到早期的 Centos 6 可以使其再次工作。伺服器端的X11日誌中沒有任何內容。我跑過去strace glxgears,沒有註意到任何異常。我可以嘗試做什麼進一步診斷?

編輯:在任何現代 Linux 上,以下強制間接渲染上下文的嘗試都會失敗:

glxinfo -i
name of display: :0
X Error of failed request:  BadValue (integer parameter out of range for operation)
Major opcode of failed request:  154 (GLX)
Minor opcode of failed request:  24 (X_GLXCreateNewContext)
Value in failed request:  0x0
Serial number of failed request:  39
Current serial number in output stream:  40

我嘗試了以下方法來重新啟用間接渲染。除非我弄錯了,所有這些都必須在客戶端電腦上完成:

  • 在 /etc/X11/xorg.conf 的「螢幕」或「設備」部分中新增:

    選項“AllowIndirectGLXProtocol”“True”

  • 在 /usr/bin/startx 中(或 startx 所在的任何位置):

    預設伺服器參數=“+iglx”

  • 在 /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf 中更改行:

    xserver-command=X -core +iglx

  • 在啟動 KDE 之前,例如在 .kde/env/igl.sh 中

    導出 LIBGL_ALWAYS_INDIRECT=1

這些都不起作用。

答案1

Linux工作站

反常的是,有很多版本GDM 不提供一種傳遞參數的方法,例如+iglxto Xorg。作為回應,新的 X.org 版本有一個IndirectGLX選項(也可以看看範例xorg.conf文字)。

如果沒有該選項,有一個解決方法Xorg用 shell 腳本包裝自身:

mv /usr/bin/Xorg /usr/bin/Xorg.original
echo -e '#!/usr/bin/env bash\nexec /usr/bin/Xorg.original "$@" +iglx' > /usr/bin/Xorg
chmod +x /usr/bin/Xorg
chcon --type=bin_t /usr/bin/Xorg

macOS 工作站 (XQuartz)

趕緊跑

defaults write org.macosforge.xquartz.X11 enable_iglx -bool true

如果 XQuartz 正在運行,請重新啟動它。 (注意拼字錯誤:沒有對域和變數名稱進行錯誤檢查。)最近的版本使用更簡單的org.xquartz.X11.

相關內容