远程桌面打开mayavi,基于VirtualGL + Turbovnc

实现内容:

远程桌面打开mayavi,基于VirtualGL + Turbovnc

参考链接:

链接1.

下面是复制过来的内容,附加上我的注释:

Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding

How to setup VirtualGL and TurboVNC on Ubuntu.md

VirtualGL

When you use ssh with X forwarding, you might have noticed that you cannot execute programs that require 3D acceleration. That’s where VirtualGL comes into play.

VirtualGL is an open source toolkit that gives any Unix or Linux remote display software the ability to run OpenGL applications with full 3D hardware acceleration.

With VirtualGL, the OpenGL commands and 3D data are instead redirected to a 3D graphics accelerator (AKA “graphics processing unit” or “GPU”) in the application server, and only the rendered 3D images are sent to the client machine.

Inititalization

Download the following packages for the server:

The .deb package for VirtualGL on sourceforge
The .deb package for TurboVNC on sourceforge

首先从上方链接下载VirtualGL和TurboVNC的安装包

Installation

Make sure you have installed the proprietary drivers for your graphics card (at least for Nvidia that I have tested this setup).

1. Install virtualgl on Ubuntu, by installing the deb file you already downloaded:
sudo dpkg -i virtualgl_*.deb

Shutdown the display manager and configure virtualgl server:
login as root
If you are using KDE, install lightdm (sudo apt-get install lightdm)
otherwise the following configuration steps do not work with SDDM (yet)

service lightdm stop
/opt/VirtualGL/bin/vglserver_config

Go through the questions until the configuration is done.

sudo reboot

Sanity check for restricted access to 3D X Server

xauth merge /etc/opt/VirtualGL/vgl_xauth_key
xdpyinfo -display :0
/opt/VirtualGL/bin/glxinfo -display :0 -c

安装VirtualGL的deb包,然后进行config配置,我配置的选项为1,配置完成后选择x退出;
重启服务器,使配置生效

2. Check that the Graphic card is indeed used and not Mesa

Install TurboVNC:

sudo dpkg -i turbovnc_*.deb

For the TurboVNC clients, you can find them at the same address

Use
Launch /opt/TurboVNC/bin/vncserver on the server. Possible options:
-otp: enable One Time Password
-geometry x: specify size of the window
Connect using TurboVNC client (/opt/TurboVNC/bin/vncviewer). (The screen will appear black but X is launched)
In a terminal on the server
export the DISPLAY variable to the value used by vncserver
export DISPLAY=:1 # if your vncserver started in DISPLAY :1
Launch an X App (with vglrun to have 3D acceleration)

接下来是安装TurboVNC,然后启动vncserver,不多赘述;

Example command

vglrun glxgears
Tips
To get a window manager up and running (in order to not have the black screen) do the following:

With the command vncserver -list find the started vnc server. This command will give you an output that looks like this:
$ vncserver -list

TurboVNC server sessions:

X DISPLAY # PROCESS ID
:1 8972
Kill the started VNC server with the command vncserver -kill :1. Change the :1 with the X DISPLAY value returned by the vncserver -list command earlier.

Make sure that the commands xfce4-panel and xfce4-session exist in your system (if not install them), and append the following line at the end of the file ~/.vnc/xstartup.turbovnc.

xfce4-session &
Now start the vncserver again:
/opt/TurboVNC/bin/vncserver
Export PATH variables:

export PATH=/opt/TurboVNC/bin:$PATH


链接2

How to set up VirtualGL and TurboVNC for use with ParaViewWeb

第二个链接内容比较多,就不再贴出来了,具体内容差不多,建议两个链接结合着看,我也不是很清楚具体的原理,只是这种方法确实有用。

另外,如果安装完后出现

Failed to initialize NVML: Insufficient Permissions

的提示的话,是没有添加用户组的缘故,可以仿照下面的指令,把当前用户添加进vglusers用户组,就可以正常使用了。

sudo usermod -a -G vglusers kitware
sudo usermod -a -G vglusers root

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值