Skip to content

Commit b97266e

Browse files
committed
Updated remote server documentation
1 parent 6f366c9 commit b97266e

File tree

1 file changed

+59
-24
lines changed

1 file changed

+59
-24
lines changed
Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,75 @@
11
Running FAST on a remote server {#fast-remote-server}
22
========================================
33

4-
FAST can run on a remote Linux server using SSH.
4+
FAST can run on a remote Linux server using SSH. [Install FAST and its dependencies for Linux](@ref install-ubuntu-linux).
55

6-
**If you don't want to do any visualization, you don't have to do anything extra.** FAST will detect that there is no display to render and thus disable visualization (i.e. OpenGL) in FAST. If you try to do anything that requires OpenGL (rendering etc.) FAST will crash.
6+
**If you don't want to do any visualization, you don't have to do anything extra.**
7+
FAST will detect that there is no display to render and thus disable visualization (i.e. OpenGL) in FAST.
8+
If you try to do anything that requires OpenGL (rendering etc.) FAST will throw an exception.
79

8-
**If you want to run FAST with visualization on a remote server you need to use [VirtualGL](https://virtualgl.org/).** Indirect rendering over SSH with X forwarding (ssh -X) will not work because FAST uses modern OpenGL (3+), which indirect GLX does not support (however some have reported that modern Mesa OpenGL does support this).
10+
However, if you want to do rendering and visualization with FAST on a remote headless server, you need to use OpenGL, X and GLX.
11+
To do this, you either need Xvfb or VirtualGL depending on whether you want an interactive FAST window or not, see below for more information.
912

10-
### Setting up VirtualGL
11-
12-
**WARNING: Installing VirtualGL can mess up your system if not done correctly. Make sure you know what you are doing. Also, note that this guide has not been updated for a long time.**
13+
## Remote FAST visualization WITHOUT interactive window
14+
**If you only want to render a visualization FAST, without interactive having an window, you can use Xvfb**.
15+
Since X requires a display, which you don't necessarily have on a headless server, you
16+
can use Xvfb (X virtual framebuffer) to create a virtual screen.
1317

14-
Install VirtualGL on the client machine (If windows, see [documentation here](https://rawcdn.githack.com/VirtualGL/virtualgl/main/doc/index.html#hd005003)):
15-
```bash
16-
sudo apt install virtualgl
17-
```
18-
Then, install VirtualGL on the server machine:
18+
First install Xvfb:
1919
```bash
20-
sudo apt install virtualgl
20+
sudo apt install xvfb
2121
```
22-
If your server is *headless*, meaning it has no display connected, you need to setup an "empty" X display.
23-
If your server uses the NVIDIA driver, you can do this with the following command:
22+
Then you can create a virtual screen with a given resolution and DISPLAY ID:
23+
The DISPLAY ID should be unique, so if you have multiple users, and/or a real screen attached to the server.
24+
Make sure you select a DISPLAY ID which is unused.
2425
```bash
25-
sudo nvidia-xconfig -a --use-display-device=None --virtual=1280x1024
26+
DISPLAY=:10 # Set the DISPLAY environment variable
27+
Xvfb "$DISPLAY" -screen 0 1920x1080x24 & # You can change the resolution here if wanted
2628
```
27-
This will create a new xorg.conf config file in the folder /etc/X11/.
2829

29-
Then run the virtualgl config on your server:
30-
```
31-
vglserver_config
30+
Now you should be able to render a FAST visualization on a headless remote server which you can then save to an image file
31+
or display with another visualization program which can run with X forwarding, for instance matplotlib if you are using python.
32+
33+
## Examples
34+
Make sure you have Xvfb running and the DISPLAY environment variable active in the terminal
35+
you are running these examples from.
36+
37+
**Example of remote headless rendering to an image file with FAST using python:**
38+
```python
39+
import fast
40+
41+
importer = fast.ImageFileImporter.create(fast.Config.getDocumentationPath() + '/images/FAST_logo_square.png')
42+
renderer = fast.ImageRenderer.create().connect(importer)
43+
visualization = fast.RenderToImage.create(width=1024).connect(renderer)
44+
fast.ImageFileExporter.create('fast_remote_render.jpg')\
45+
.connect(visualization)\
46+
.run()
3247
```
33-
Finally restart X on your server, or just reboot:
34-
```bash
35-
sudo systemctl restart gdm
48+
49+
**Example of remote headless rendering with FAST and display using matplotlib:**
50+
```python
51+
import fast
52+
import matplotlib.pyplot as plt
53+
54+
importer = fast.ImageFileImporter.create(fast.Config.getDocumentationPath() + '/images/FAST_logo_square.png')
55+
renderer = fast.ImageRenderer.create().connect(importer)
56+
visualization = fast.RenderToImage.create(width=1024)\
57+
.connect(renderer)\
58+
.runAndGetOutputData()
59+
60+
plt.imshow(visualization)
61+
plt.show()
3662
```
37-
If something goes wrong, remove the xorg.conf that was created (or replace it with the backup /etc/X11/xorg.conf.backup) and reboot.
63+
64+
## Remote FAST visualization WITH interactive window
65+
**If you want to run FAST with interactive visualization on a remote server you need to use [VirtualGL](https://virtualgl.org/).**
66+
Indirect rendering over SSH with X forwarding (ssh -X) will not work because FAST uses modern OpenGL (3+), which indirect GLX does not support (however some have reported that modern Mesa OpenGL does support this).
67+
68+
### Setting up VirtualGL
69+
70+
**WARNING: Installing VirtualGL can mess up your system if not done correctly. Make sure you know what you are doing. Also, note that this guide has not been updated for a long time.**
71+
72+
Follow the instructions on installing VirtualGL from the [official VGL documentation](https://virtualgl.org/).
3873

3974
### Using FAST with VirtualGL
4075
Instead of using the ssh command to connect to the server, connect with the following virtualgl command instead:
@@ -54,4 +89,4 @@ vglrun python
5489
vglrun python your_script.py
5590
```
5691

57-
For more information on VirtualGL over SSH, see [documentation here](https://rawcdn.githack.com/VirtualGL/virtualgl/main/doc/index.html#hd008).
92+
For more info, read the [official VirtualGL documentation](https://virtualgl.org/).

0 commit comments

Comments
 (0)