如何從我的 Windows 機器運行安裝在 linux 機器上的 OpenGL 應用程序? (How can I run an OpenGL application installed on a linux machine from my windows machine?)


問題描述

如何從我的 windows 機器運行安裝在 linux 機器上的 OpenGL 應用程序? (How can I run an OpenGL application installed on a linux machine from my windows machine?)

本著樂於助人的精神,這是我遇到並解決的問題,所以我將在這裡回答這個問題。

問題

我有:

必須在 Redhat 或 SuSE 企業上安裝的應用程序。

它有巨大的系統要求,需要 OpenGL。

它是一套工具的一部分,需要在一台機器上一起運行。

這個應用程序是用於工時方面的時間密集型任務。

我不想坐在服務器機房里處理這個應用程序。

所以,問題來了.. . 如何從遠程 Windows 機器運行此應用程序?

我將概述我的解決方案。隨意評論替代品。該解決方案也適用於更簡單的環境。我的情況有些極端。


參考解法

方法 1:

Solution

I installed two pieces of software:

PuTTY

XMing‑mesa The mesa part is important.

PuTTY configuration

Connection‑>Seconds Between Keepalives: 30
Connection‑>Enable TCP Keepalives: Yes

Connection‑>SSH‑>X11‑>Enable X11 forwarding: Yes
Connection‑>SSH‑>X11‑>X display location: localhost:0:0

Lauching

Run Xming which will put simply start a process and put an icon in your system tray. Launch putty, pointing to your linux box, with the above configuration. Run program

Hopefully, Success!

方法 2:

If you want the OpenGL rendering to be performed on your local machine, using a Windows X server, like Xming is a good solution. However, if you want rendering to be done on the remote end with just images sent to the local machine, you want a specialized VNC system that can handle remote OpenGL rendering, like VirtualGL.

方法 3:

You could also use VNC ( like cross platform remote desktop ) X is more efficent since it only sends draw commands rather than pixels, but if you are using opengl it is likely that most of the data is a rendered image anyway.

Another big advantage of VNC is that you can start the program locally on the server and then connect to it with VNC, drop the connection, reconnect from another machine etc without disturbing the main running program.

方法 4:

For OpenGL, running an X server is definitely a better solution. Just make sure the application is developed to be networked. It should NOT use immediate mode for rendering and textures should be RARELY transferred.

Why is X server a better solution in this case (as opposed to VNC)? Because you get acceleration on workstation, while VNC'ed solution is usually not even accelerated on the mainframe. So as long as data is buffered on the X server (using vertex arrays, vertex buffer objects, texture objects, etc) you should get much higher speed than using VNC, especially with complex scenes since VNC has to analyze, transfer and decode them as pixels.

方法 5:

If you need server glx version 1.2 the free version of Xming (Mesa 2007) works fine. But if your application needs version 1.4, example qt5, the X Server from Cygwin works free to run it use this commands:

[On server]

sudo vi /etc/ssh/ssh_config

Add:

X11Forwarding yes

X11DisplayOffset 10

X11UseLocalHost no

AllowTcpForwarding yes

TCPKeepAlive yes

ClientAliveInterval 30

ClientAliveCountMax 10000

sudo vi ~/.bashrc

Add:

export DISPLAY=ip_from_remote:0

Now restart ssh server

[On Client slide]

Install Cygwin64 (with support to X package) after that run this command:

d:\cygwin64\bin\run.exe ‑‑quote /usr/bin/bash.exe ‑l ‑c "cd; /usr/bin/xinit /etc/X11/xinit/startxwinrc ‑‑ /usr/bin/XWin :0 ‑ac ‑multiwindow ‑listen tcp"

Now execute ssh client:

d:\cygwin64\bin\mintty.exe ‑i /Cygwin‑Terminal.ico ‑e /usr/bin/ssh ‑Y user_name@ip_from_server

(by scubabblscubabbltkerwinMartin BeckettIvan VučicaRafael Duarte)

參考文件

  1. How can I run an OpenGL application installed on a linux machine from my windows machine? (CC BY‑SA 2.5/3.0/4.0)

#putty #opengl #linux #x11 #sysadmin






相關問題

如何從我的 Windows 機器運行安裝在 linux 機器上的 OpenGL 應用程序? (How can I run an OpenGL application installed on a linux machine from my windows machine?)

正確的自動命令以在膩子中連接到路由器 (correct autocommand to connect to router in putty)

Sun OS 5.10: Bash: Warna dan Daftar Direktori (Sun OS 5.10: Bash: Colors and Directory Listings)

WinSCP:服務器拒絕了我們的密鑰 (WinSCP: Server refused our key)

psftp 批處理腳本不起作用 (psftp batch script won't work)

'vagrant ssh' 不適用於 vagrant-multi-putty 插件 ('vagrant ssh' not working with the vagrant-multi-putty plugin)

uft type 命令沒有正確輸入 i 字符 (uft type command does not input i character properly)

使用 pscp 並獲得權限被拒絕 (Using pscp and getting permission denied)

當我在我的膩子程序中使用 vim 時,我遇到了一個自動完成問題 (When I using vim in my putty program, I have an autocomplete issue)

使用 c# System.IO.Ports.SerialPort 寫入 Cisco 交換機並不總是有效 (Write to Cisco Switch with c# System.IO.Ports.SerialPort doesn't always work)

錯誤:ARM 的行尾出現垃圾 -as 和 -o 錯誤 (Error: Junk at end of line -as and -o error with ARM)

在 PowerShell 中重用正在運行的 PuTTY 代理(選美) (Reuse in PowerShell a running PuTTY agent (pageant))







留言討論