如何从 Windows 计算机运行安装在 Linux 计算机上的 OpenGL 应用程序?

发布于 2024-07-04 20:03:40 字数 367 浏览 10 评论 0原文

本着乐于助人的精神,这是我遇到并解决的问题,所以我将在这里回答这个问题。

问题

我有:

一个必须安装在 Redhat 或 SuSE 企业上的应用程序。

它对系统的要求很高,并且需要OpenGL。

它是需要在一台机器上一起操作的一套工具的一部分。

该应用程序用于工时方面的时间密集型任务。

我不想坐在服务器机房里处理这个应用程序。

那么,问题来了...我如何从远程 Windows 机器运行这个应用程序?

我将概述我的解决方案。 请随意评论替代方案。 该解决方案也适用于更简单的环境。 我的情况有点极端。

In the spirit of being helpful, this is a problem I had and solved, so I will answer the question here.

Problem

I have:

An application that has to be installed on on Redhat or SuSE enterprise.

It has huge system requirements and requires OpenGL.

It is part of a suite of tools that need to operate together on one machine.

This application is used for a time intensive task in terms of man hours.

I don't want to sit in the server room working on this application.

So, the question came up... how do I run this application from a remote windows machine?

I'll outline my solution. Feel free to comment on alternatives. This solution should work for simpler environments as well. My case is somewhat extreme.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

静若繁花 2024-07-11 20:03:41

如果您希望在本地计算机上执行 OpenGL 渲染,那么使用 Windows X 服务器(例如 Xming)是一个很好的解决方案。 但是,如果您希望在远程端完成渲染,仅将图像发送到本地计算机,则需要一个可以处理远程 OpenGL 渲染的专用 VNC 系统,例如 VirtualGL.

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.

转身泪倾城 2024-07-11 20:03:41

您还可以使用VNC(如跨平台远程桌面)
X 更高效,因为它只发送绘制命令而不是像素,但如果您使用 opengl,则大多数数据很可能都是渲染图像。

VNC 的另一大优点是,您可以在服务器本地启动程序,然后使用 VNC 连接到它、断开连接、从另一台机器重新连接等,而不会干扰主运行程序。

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.

岛歌少女 2024-07-11 20:03:41

对于OpenGL来说,运行X服务器绝对是更好的解决方案。 只需确保应用程序是为联网而开发的。 它不应该使用立即模式进行渲染,并且应该很少传输纹理。

为什么在这种情况下 X 服务器是更好的解决方案(相对于 VNC)? 因为您可以在工作站上获得加速,而 VNC 解决方案通常甚至无法在大型机上加速。 因此,只要数据在 X 服务器上缓冲(使用顶点数组、顶点缓冲对象、纹理对象等),您就应该获得比使用 VNC 高得多的速度,特别是对于复杂的场景,因为 VNC 必须分析、传输和解码它们像素。

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.

过潦 2024-07-11 20:03:41

如果您需要服务器 glx 版本 1.2,则免费版本的 Xming (Mesa 2007) 可以正常工作。 但如果您的应用程序需要版本 1.4,例如 qt5,Cygwin 的 X Server 可以使用以下命令免费运行它:

[在服务器上]

sudo vi /etc/ssh/ssh_config

添加:

X11转发是

X11显示偏移10

X11UseLocalHost 否

允许Tcp转发是

TCPKeepAlive 是

ClientAliveInterval 30

ClientAliveCountMax 10000

sudo vi ~/.bashrc

添加:

导出 DISPLAY=ip_from_remote:0

现在重新启动 ssh 服务器

[在客户端幻灯片上]

安装 Cygwin64 (支持 X包)之后运行此命令:

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"

现在执行 ssh 客户端:

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

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
风渺 2024-07-11 20:03:40

解决方案

我安装了两个软件:

PuTTY

XMing-mesa 台面部分很重要。

PuTTY 配置

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

启动

运行Xming,这将简单地启动一个进程并在系统托盘中放置一个图标。
启动 putty,指向您的 Linux 盒子,并进行上述配置。
运行程序

希望成功!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文