Vì vậy, tôi muốn bắt đầu trò chơi từ thiết bị đầu cuối SSH của mình.
Điều này thực sự kỳ lạ, khi tôi thực hiện việc này trực tiếp từ GUI Linux, nó vẫn hoạt động. Nhưng khi tôi sử dụng máy khách SSH để kết nối từ xa thì nó gặp sự cố. Có vẻ như nó liên quan đến trình điều khiển hiển thị của tôi.
Ngoại lệ chưa được xử lý:
System.TypeInitializationException: Trình khởi tạo kiểu cho OpenTK.DisplayDevice ---> System.IO.DirectoryNotFoundException: Không tìm thấy thư mục '/dev/dri'.
tại System.IO.Directory.ValidateDirectoryListing (Đường dẫn System.String, System.String searchPattern, System.Boolean& stop) [0x00000] trong :0
tại System.IO.Directory.GetFileSystemEntries (đường dẫn System.String, System.String searchPattern, mặt nạ FileAttribut, FileAttrs attrs) [0x00000] trong :0
tại System.IO.Directory.GetFiles (đường dẫn System.String, System.String searchPattern) [0x00000] trong :0
tại System.IO.Directory.GetFiles (đường dẫn System.String) [0x00000] trong :0
tại OpenTK.Platform.Linux.LinuxFactory.CreateDisplay (System.IntPtr& gbm_device, System.IntPtr& egl_display) [0x00000] trong :0
tại OpenTK.Platform.Linux.LinuxFactory.get_gpu_fd () [0x00000] trong :0
tại OpenTK.Platform.Linux.LinuxFactory.CreateDisplayDeviceDriver () [0x00000] trong :0
tại OpenTK.DisplayDevice..cctor () [0x00000] trong :0
--- Kết thúc dấu vết ngăn xếp ngoại lệ bên trong ---
tại OpenTK.NativeWindow..ctor () [0x00000] trong :0
tại Microsoft.Xna.Framework.OpenTKGameWindow.Initialize (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.OpenTKGameWindow..ctor (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.OpenTKGamePlatform..ctor (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.GamePlatform.Create (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.Game..ctor () [0x00000] trong :0
tại TestGame.Game1..ctor () [0x00000] trong :0
tại TestGame.Program.RunGame () [0x00000] trong :0
tại TestGame.Program.Main (System.String[] args) [0x00000] trong :0
[LỖI] NGOẠI LỆ KHÔNG ĐƯỢC XỬ LÝ TUYỆT VỜI: System.TypeInitializationException: Một ngoại lệ được đưa ra bởi trình khởi tạo loại cho OpenTK.DisplayDevice ---> System.IO.DirectoryNotFoundException: Không tìm thấy thư mục '/dev/dri'.
tại System.IO.Directory.ValidateDirectoryListing (Đường dẫn System.String, System.String searchPattern, System.Boolean& stop) [0x00000] trong :0
tại System.IO.Directory.GetFileSystemEntries (đường dẫn System.String, System.String searchPattern, mặt nạ FileAttribut, FileAttrs attrs) [0x00000] trong :0
tại System.IO.Directory.GetFiles (đường dẫn System.String, System.String searchPattern) [0x00000] trong :0
tại System.IO.Directory.GetFiles (đường dẫn System.String) [0x00000] trong :0
tại OpenTK.Platform.Linux.LinuxFactory.CreateDisplay (System.IntPtr& gbm_device, System.IntPtr& egl_display) [0x00000] trong :0
tại OpenTK.Platform.Linux.LinuxFactory.get_gpu_fd () [0x00000] trong :0
tại OpenTK.Platform.Linux.LinuxFactory.CreateDisplayDeviceDriver () [0x00000] trong :0
tại OpenTK.DisplayDevice..cctor () [0x00000] trong :0
--- Kết thúc dấu vết ngăn xếp ngoại lệ bên trong ---
tại OpenTK.NativeWindow..ctor () [0x00000] trong :0
tại Microsoft.Xna.Framework.OpenTKGameWindow.Initialize (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.OpenTKGameWindow..ctor (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.OpenTKGamePlatform..ctor (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.GamePlatform.Create (trò chơi Microsoft.Xna.Framework.Game) [0x00000] trong :0
tại Microsoft.Xna.Framework.Game..ctor () [0x00000] trong :0
tại TestGame.Game1..ctor () [0x00000] trong :0
tại TestGame.Program.RunGame () [0x00000] trong :0
tại TestGame.Program.Main (System.String[] args) [0x00000] trong :0
Mặc dù tôi đã tạo một tập lệnh bash và sau đó gọi nó như một phương pháp để khởi chạy trò chơi, nhưng tiếc là nó lại tạo ra kết quả tương tự.
Về cơ bản, khi tôi chạy lệnh SAME EXACT trong GUI Linux, trò chơi khởi chạy mà không gặp vấn đề gì, nhưng khi tôi chạy lệnh SAME EXACT từ xa trong SSH, trò chơi không khởi chạy được và bị kẹt ở đó.
mono /home/pi/.../game/TestGame.exe
Tôi đang chạy Linux Raspbian trên Raspberry Pi. Raspberry Pi của tôi được kết nối với màn hình của tôi. Khi cắm bàn phím của tôi, nó khởi động, khi thử từ máy tính khác của tôi bằng ssh thì nó gặp lỗi như chúng tôi thấy ở đây.
Bất kỳ trợ giúp sẽ được đánh giá rất cao.
Cảm ơn bạn rất nhiều!Kevin
Theo dõi những phát hiện của tôi,
Nếu gặp lỗi này thì có 2 điều bạn cần lưu ý:
- Kiểm tra xem bạn đã kích hoạt chuyển tiếp X11 trong thiết bị đầu cuối SSH chưa.
Nhập dòng ma thuật này để báo cho SSH biết nên sử dụng màn hình nào. Nếu không thì bất kỳ phần mềm đồ họa nào cũng sẽ gặp sự cố khi khởi động.
XuấtDISPLAY=:0
Cảm ơn, Kev
Tôi là một lập trình viên xuất sắc, rất giỏi!