gpt4 book ai didi

linux - 无法从 SSH 启动 MonoGame,但可以从 GUI 启动

转载 作者:太空宇宙 更新时间:2023-11-04 03:41:35 31 4
gpt4 key购买 nike

所以我想从我的 SSH 终端开始游戏。

这真的很奇怪,当我直接从 Linux GUI 执行此操作时,它可以工作。但是当我使用 SSH 客户端进行远程连接时,它就崩溃了。似乎与我的显示驱动程序有关。

Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.DisplayDevice ---> System.IO.DirectoryNotFoundException: Directory '/dev/dri' not found.
at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFiles (System.String path) [0x00000] in <filename unknown>:0
at OpenTK.Platform.Linux.LinuxFactory.CreateDisplay (System.IntPtr& gbm_device, System.IntPtr& egl_display) [0x00000] in <filename unknown>:0
at OpenTK.Platform.Linux.LinuxFactory.get_gpu_fd () [0x00000] in <filename unknown>:0
at OpenTK.Platform.Linux.LinuxFactory.CreateDisplayDeviceDriver () [0x00000] in <filename unknown>:0
at OpenTK.DisplayDevice..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at OpenTK.NativeWindow..ctor () [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.OpenTKGameWindow.Initialize (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.OpenTKGameWindow..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.OpenTKGamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Game..ctor () [0x00000] in <filename unknown>:0
at TestGame.Game1..ctor () [0x00000] in <filename unknown>:0
at TestGame.Program.RunGame () [0x00000] in <filename unknown>:0
at TestGame.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.DisplayDevice ---> System.IO.DirectoryNotFoundException: Directory '/dev/dri' not found.
at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFiles (System.String path) [0x00000] in <filename unknown>:0
at OpenTK.Platform.Linux.LinuxFactory.CreateDisplay (System.IntPtr& gbm_device, System.IntPtr& egl_display) [0x00000] in <filename unknown>:0
at OpenTK.Platform.Linux.LinuxFactory.get_gpu_fd () [0x00000] in <filename unknown>:0
at OpenTK.Platform.Linux.LinuxFactory.CreateDisplayDeviceDriver () [0x00000] in <filename unknown>:0
at OpenTK.DisplayDevice..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at OpenTK.NativeWindow..ctor () [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.OpenTKGameWindow.Initialize (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.OpenTKGameWindow..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.OpenTKGamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Game..ctor () [0x00000] in <filename unknown>:0
at TestGame.Game1..ctor () [0x00000] in <filename unknown>:0
at TestGame.Program.RunGame () [0x00000] in <filename unknown>:0
at TestGame.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

虽然我创建了一个 bash 脚本,然后将其称为启动游戏的方法,但不幸的是它会产生相同的结果。

基本上,当我在 Linux GUI 中运行 SAME EXACT 命令时,游戏启动没有问题,但是当我在 SSH 中远程运行 SAME EXACT 命令时,游戏无法启动并且卡在那里。

mono /home/pi/.../game/TestGame.exe

我正在树莓派上运行 Linux Raspbian。我的树莓派已连接到我的屏幕上。当插入我的键盘时,它会启动,当使用 ssh 从我的另一台计算机上尝试时,它会崩溃,并出现我们在此处看到的错误。

如果有任何帮助,我将不胜感激。

非常感谢!凯文

最佳答案

跟进我的发现,

如果您遇到此错误,需要注意两件事:

  1. 检查您是否在 SSH 终端中激活了 X11 转发。
  2. 输入这个神奇的行来告诉 SSH 使用哪个监视器。否则任何图形软件都会在启动时崩溃。

    导出DISPLAY=:0

谢谢,凯夫

关于linux - 无法从 SSH 启动 MonoGame,但可以从 GUI 启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29442348/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com