remote-visualization.md 7.91 KB
Newer Older
Lukáš Krupčík's avatar
Lukáš Krupčík committed
1 2 3
# Remote visualization service

## Introduction
Lukáš Krupčík's avatar
Lukáš Krupčík committed
4

Lukáš Krupčík's avatar
Lukáš Krupčík committed
5 6 7 8 9 10
The goal of this service is to provide the users a GPU accelerated use of OpenGL applications, especially for pre- and post- processing work, where not only the GPU performance is needed but also fast access to the shared file systems of the cluster and a reasonable amount of RAM.

The service is based on integration of open source tools VirtualGL and TurboVNC together with the cluster's job scheduler PBS Professional.

Currently two compute nodes are dedicated for this service with following configuration for each node:

David Hrbáč's avatar
David Hrbáč committed
11 12 13 14 15 16 17 18
| [**Visualization node configuration**](compute-nodes/) |                                         |
| ------------------------------------------------------ | --------------------------------------- |
| CPU                                                    | 2 x Intel Sandy Bridge E5-2670, 2.6 GHz |
| Processor cores                                        | 16 (2 x 8 cores)                        |
| RAM                                                    | 64 GB, min. 4 GB per core               |
| GPU                                                    | NVIDIA Quadro 4000, 2 GB RAM            |
| Local disk drive                                       | yes - 500 GB                            |
| Compute network                                        | InfiniBand QDR                          |
Lukáš Krupčík's avatar
Lukáš Krupčík committed
19

Lukáš Krupčík's avatar
Lukáš Krupčík committed
20
## Schematic overview
Lukáš Krupčík's avatar
Lukáš Krupčík committed
21

Lukáš Krupčík's avatar
Lukáš Krupčík committed
22
![rem_vis_scheme](../img/scheme.png "rem_vis_scheme")
Lukáš Krupčík's avatar
Lukáš Krupčík committed
23

Lukáš Krupčík's avatar
Lukáš Krupčík committed
24
![rem_vis_legend](../img/legend.png "rem_vis_legend")
Lukáš Krupčík's avatar
Lukáš Krupčík committed
25

Lukáš Krupčík's avatar
Lukáš Krupčík committed
26
## How to use the service
Lukáš Krupčík's avatar
Lukáš Krupčík committed
27

Lukáš Krupčík's avatar
Lukáš Krupčík committed
28
### Setup and start your own TurboVNC server
Lukáš Krupčík's avatar
Lukáš Krupčík committed
29

30
TurboVNC is designed and implemented for cooperation with VirtualGL and available for free for all major platforms. For more information and download, please refer to: <http://sourceforge.net/projects/turbovnc/>
Lukáš Krupčík's avatar
Lukáš Krupčík committed
31

Lukáš Krupčík's avatar
Lukáš Krupčík committed
32
**Always use TurboVNC on both sides** (server and client) **don't mix TurboVNC and other VNC implementations** (TightVNC, TigerVNC, ...) as the VNC protocol implementation may slightly differ and diminish your user experience by introducing picture artifacts, etc.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
33 34 35

The procedure is:

Lukáš Krupčík's avatar
Lukáš Krupčík committed
36
#### 1. Connect to a login node
Lukáš Krupčík's avatar
Lukáš Krupčík committed
37

Pavel Jirásek's avatar
Pavel Jirásek committed
38
Please [follow the documentation](shell-and-data-access/).
Lukáš Krupčík's avatar
Lukáš Krupčík committed
39

Lukáš Krupčík's avatar
Lukáš Krupčík committed
40
#### 2. Run your own instance of TurboVNC server
Lukáš Krupčík's avatar
Lukáš Krupčík committed
41

Lukáš Krupčík's avatar
Lukáš Krupčík committed
42
To have the OpenGL acceleration, **24 bit color depth must be used**. Otherwise only the geometry (desktop size) definition is needed.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
43

David Hrbáč's avatar
David Hrbáč committed
44
_At first VNC server run you need to define a password._
Lukáš Krupčík's avatar
Lukáš Krupčík committed
45

Lukáš Krupčík's avatar
Lukáš Krupčík committed
46
This example defines desktop with dimensions 1200x700 pixels and 24 bit color depth.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
47

Lukáš Krupčík's avatar
Lukáš Krupčík committed
48 49 50
```bash
$ module load turbovnc/1.2.2
$ vncserver -geometry 1200x700 -depth 24
Lukáš Krupčík's avatar
Lukáš Krupčík committed
51

Lukáš Krupčík's avatar
Lukáš Krupčík committed
52
Desktop 'TurboVNC: login2:1 (username)' started on display login2:1
Lukáš Krupčík's avatar
Lukáš Krupčík committed
53

Lukáš Krupčík's avatar
Lukáš Krupčík committed
54 55 56
Starting applications specified in /home/username/.vnc/xstartup.turbovnc
Log file is /home/username/.vnc/login2:1.log
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
57

Lukáš Krupčík's avatar
Lukáš Krupčík committed
58
#### 3. Remember which display number your VNC server runs (you will need it in the future to stop the server)
Lukáš Krupčík's avatar
Lukáš Krupčík committed
59

Lukáš Krupčík's avatar
Lukáš Krupčík committed
60 61
```bash
$ vncserver -list
Lukáš Krupčík's avatar
Lukáš Krupčík committed
62

Lukáš Krupčík's avatar
Lukáš Krupčík committed
63
TurboVNC server sessions:
Lukáš Krupčík's avatar
Lukáš Krupčík committed
64

Lukáš Krupčík's avatar
Lukáš Krupčík committed
65 66 67
X DISPLAY # PROCESS ID
:1 23269
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
68 69 70

In this example the VNC server runs on display **:1**.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
71
#### 4. Remember the exact login node, where your VNC server runs
Lukáš Krupčík's avatar
Lukáš Krupčík committed
72

Lukáš Krupčík's avatar
Lukáš Krupčík committed
73
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
74
$ uname -n
Lukáš Krupčík's avatar
Lukáš Krupčík committed
75 76
login2
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
77 78 79

In this example the VNC server runs on **login2**.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
80
#### 5. Remember on which TCP port your own VNC server is running
Lukáš Krupčík's avatar
Lukáš Krupčík committed
81 82 83

To get the port you have to look to the log file of your VNC server.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
84 85 86 87
```bash
$ grep -E "VNC.*port" /home/username/.vnc/login2:1.log
20/02/2015 14:46:41 Listening for VNC connections on TCP port 5901
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
88 89 90

In this example the VNC server listens on TCP port **5901**.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
91
#### 6. Connect to the login node where your VNC server runs with SSH to tunnel your VNC session
Lukáš Krupčík's avatar
Lukáš Krupčík committed
92 93 94

Tunnel the TCP port on which your VNC server is listenning.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
95 96 97
```bash
$ ssh login2.anselm.it4i.cz -L 5901:localhost:5901
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
98

99
x-window-system/
David Hrbáč's avatar
David Hrbáč committed
100
_If you use Windows and Putty, please refer to port forwarding setup  in the documentation:_
101
[x-window-and-vnc#section-12](../get-started-with-it4innovations/accessing-the-clusters/graphical-user-interface/x-window-system/)
Lukáš Krupčík's avatar
Lukáš Krupčík committed
102

Lukáš Krupčík's avatar
Lukáš Krupčík committed
103
#### 7. If you don't have Turbo VNC installed on your workstation
Lukáš Krupčík's avatar
Lukáš Krupčík committed
104 105 106

Get it from: <http://sourceforge.net/projects/turbovnc/>

Lukáš Krupčík's avatar
Lukáš Krupčík committed
107
#### 8. Run TurboVNC Viewer from your workstation
Lukáš Krupčík's avatar
Lukáš Krupčík committed
108

Lukáš Krupčík's avatar
Lukáš Krupčík committed
109
Mind that you should connect through the SSH tunneled port. In this example it is 5901 on your workstation (localhost).
Lukáš Krupčík's avatar
Lukáš Krupčík committed
110

Lukáš Krupčík's avatar
Lukáš Krupčík committed
111 112 113
```bash
$ vncviewer localhost:5901
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
114

David Hrbáč's avatar
David Hrbáč committed
115
_If you use Windows version of TurboVNC Viewer, just run the Viewer and use address **localhost:5901**._
Lukáš Krupčík's avatar
Lukáš Krupčík committed
116

Lukáš Krupčík's avatar
Lukáš Krupčík committed
117
#### 9. Proceed to the chapter "Access the visualization node"
Lukáš Krupčík's avatar
Lukáš Krupčík committed
118

David Hrbáč's avatar
David Hrbáč committed
119
_Now you should have working TurboVNC session connected to your workstation._
Lukáš Krupčík's avatar
Lukáš Krupčík committed
120

Lukáš Krupčík's avatar
Lukáš Krupčík committed
121
#### 10. After you end your visualization session
Lukáš Krupčík's avatar
Lukáš Krupčík committed
122

David Hrbáč's avatar
David Hrbáč committed
123
_Don't forget to correctly shutdown your own VNC server on the login node!_
Lukáš Krupčík's avatar
Lukáš Krupčík committed
124

Lukáš Krupčík's avatar
Lukáš Krupčík committed
125 126 127
```bash
$ vncserver -kill :1
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
128

Lukáš Krupčík's avatar
Lukáš Krupčík committed
129 130
### Access the visualization node

Lukáš Krupčík's avatar
Lukáš Krupčík committed
131
**To access the node use a dedicated PBS Professional scheduler queue
Lukáš Krupčík's avatar
Lukáš Krupčík committed
132 133
qviz**. The queue has following properties:

David Hrbáč's avatar
David Hrbáč committed
134 135 136
| queue                        | active project | project resources | nodes | min ncpus | priority | authorization | walltime         |
| ---------------------------- | -------------- | ----------------- | ----- | --------- | -------- | ------------- | ---------------- |
| **qviz** Visualization queue | yes            | none required     | 2     | 4         | 150      | no            | 1 hour / 8 hours |
Lukáš Krupčík's avatar
Lukáš Krupčík committed
137

David Hrbáč's avatar
David Hrbáč committed
138
Currently when accessing the node, each user gets 4 cores of a CPU allocated, thus approximately 16 GB of RAM and 1/4 of the GPU capacity. _If more GPU power or RAM is required, it is recommended to allocate one whole node per user, so that all 16 cores, whole RAM and whole GPU is exclusive. This is currently also the maximum allowed allocation per one user. One hour of work is allocated by default, the user may ask for 2 hours maximum._
Lukáš Krupčík's avatar
Lukáš Krupčík committed
139 140 141

To access the visualization node, follow these steps:

Lukáš Krupčík's avatar
Lukáš Krupčík committed
142
#### 1. In your VNC session, open a terminal and allocate a node using PBSPro qsub command
Lukáš Krupčík's avatar
Lukáš Krupčík committed
143

David Hrbáč's avatar
David Hrbáč committed
144
_This step is necessary to allow you to proceed with next steps._
Lukáš Krupčík's avatar
Lukáš Krupčík committed
145

Lukáš Krupčík's avatar
Lukáš Krupčík committed
146 147 148
```bash
$ qsub -I -q qviz -A PROJECT_ID
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
149

Lukáš Krupčík's avatar
Lukáš Krupčík committed
150
In this example the default values for CPU cores and usage time are used.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
151

Lukáš Krupčík's avatar
Lukáš Krupčík committed
152 153 154
```bash
$ qsub -I -q qviz -A PROJECT_ID -l select=1:ncpus=16 -l walltime=02:00:00
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
155

David Hrbáč's avatar
David Hrbáč committed
156
_Substitute **PROJECT_ID** with the assigned project identification string._
Lukáš Krupčík's avatar
Lukáš Krupčík committed
157 158 159

In this example a whole node for 2 hours is requested.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
160
If there are free resources for your request, you will have a shell unning on an assigned node. Please remember the name of the node.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
161

Lukáš Krupčík's avatar
Lukáš Krupčík committed
162
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
163
$ uname -n
Lukáš Krupčík's avatar
Lukáš Krupčík committed
164 165
srv8
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
166 167 168

In this example the visualization session was assigned to node **srv8**.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
169
#### 2. In your VNC session open another terminal (keep the one with interactive PBSPro job open)
Lukáš Krupčík's avatar
Lukáš Krupčík committed
170

Lukáš Krupčík's avatar
Lukáš Krupčík committed
171
Setup the VirtualGL connection to the node, which PBSPro allocated for our job.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
172

Lukáš Krupčík's avatar
Lukáš Krupčík committed
173 174 175
```bash
$ vglconnect srv8
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
176

Lukáš Krupčík's avatar
Lukáš Krupčík committed
177
You will be connected with created VirtualGL tunnel to the visualization ode, where you will have a shell.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
178

Lukáš Krupčík's avatar
Lukáš Krupčík committed
179
#### 3. Load the VirtualGL module
Lukáš Krupčík's avatar
Lukáš Krupčík committed
180

Lukáš Krupčík's avatar
Lukáš Krupčík committed
181 182 183
```bash
$ module load virtualgl/2.4
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
184

Lukáš Krupčík's avatar
Lukáš Krupčík committed
185
#### 4. Run your desired OpenGL accelerated application using VirtualGL script "vglrun"
Lukáš Krupčík's avatar
Lukáš Krupčík committed
186

Lukáš Krupčík's avatar
Lukáš Krupčík committed
187 188 189
```bash
$ vglrun glxgears
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
190

Lukáš Krupčík's avatar
Lukáš Krupčík committed
191
Please note, that if you want to run an OpenGL application which is vailable through modules, you need at first load the respective module. . g. to run the **Mentat** OpenGL application from **MARC** software ackage use:
Lukáš Krupčík's avatar
Lukáš Krupčík committed
192

Lukáš Krupčík's avatar
Lukáš Krupčík committed
193 194 195 196
```bash
$ module load marc/2013.1
$ vglrun mentat
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed
197

Lukáš Krupčík's avatar
Lukáš Krupčík committed
198
#### 5. After you end your work with the OpenGL application
Lukáš Krupčík's avatar
Lukáš Krupčík committed
199

Lukáš Krupčík's avatar
Lukáš Krupčík committed
200
Just logout from the visualization node and exit both opened terminals nd end your VNC server session as described above.
Lukáš Krupčík's avatar
Lukáš Krupčík committed
201

Lukáš Krupčík's avatar
Lukáš Krupčík committed
202 203
## Tips and Tricks

David Hrbáč's avatar
David Hrbáč committed
204
If you want to increase the responsibility of the visualization, please adjust your TurboVNC client settings in this way:
Lukáš Krupčík's avatar
Lukáš Krupčík committed
205

Lukáš Krupčík's avatar
Lukáš Krupčík committed
206
![rem_vis_settings](../img/turbovncclientsetting.png "rem_vis_settings")
Lukáš Krupčík's avatar
Lukáš Krupčík committed
207

David Hrbáč's avatar
David Hrbáč committed
208
To have an idea how the settings are affecting the resulting picture utility three levels of "JPEG image quality" are demonstrated:
Lukáš Krupčík's avatar
Lukáš Krupčík committed
209

Lukáš Krupčík's avatar
Lukáš Krupčík committed
210
** JPEG image quality = 30 **
Lukáš Krupčík's avatar
Lukáš Krupčík committed
211

Lukáš Krupčík's avatar
Lukáš Krupčík committed
212
![rem_vis_q3](../img/quality3.png "rem_vis_q3")
Lukáš Krupčík's avatar
Lukáš Krupčík committed
213

Lukáš Krupčík's avatar
Lukáš Krupčík committed
214
** JPEG image quality = 15 **
Lukáš Krupčík's avatar
Lukáš Krupčík committed
215

Lukáš Krupčík's avatar
Lukáš Krupčík committed
216
![rem_vis_q2](../img/quality2.png "rem_vis_q2")
Lukáš Krupčík's avatar
Lukáš Krupčík committed
217

Lukáš Krupčík's avatar
Lukáš Krupčík committed
218
** JPEG image quality = 10 **
Lukáš Krupčík's avatar
Lukáš Krupčík committed
219

220
![rem_vis_q1](../img/quality1.png "rem_vis_q1")