Difference between revisions of "Ifarm graphic mode"

From Hall A Wiki
Jump to: navigation, search
(vnc (recommended))
Line 1: Line 1:
 +
For any question, email Zhiwen Zhao zwzhao@jlab.org
 +
 
= Why =
 
= Why =
 
Usually we are running code on ifarm without caring about graphic because it's used for a test ground for farm job anyway.
 
Usually we are running code on ifarm without caring about graphic because it's used for a test ground for farm job anyway.
Line 22: Line 24:
 
The better way to do it is through a vnc inside ifarm. This way the code won't crash because it runs within the same environment where it is compiled and everyone will see same result. Here is how to do it
 
The better way to do it is through a vnc inside ifarm. This way the code won't crash because it runs within the same environment where it is compiled and everyone will see same result. Here is how to do it
  
  First login into ifarm with Xwindow forwarding enabled   (this is to use vncviwer)
+
  ssh -XY your_lab_username@ifarm (login with Xwindow forwarding enabled,this is to use vncviwer)
 
  mkdir .vnc
 
  mkdir .vnc
 
  edit .vnc/xstartup with lines below
 
  edit .vnc/xstartup with lines below
Line 38: Line 40:
 
  vncserver -kill :1                  ('''note the space before colons)
 
  vncserver -kill :1                  ('''note the space before colons)
  
In principle, we don't need Xwindow forwarding to use vncviewer on ifarm. We could use a local vncviewer and ssh tunneling for better performance. This can be important if you are not on jlab internal network. ask me and I can write a howto if nessary
+
= ssh tunneling and vnc =
  
For any question, email Zhiwen Zhao zwzhao@jlab.org
+
If you computer is outside of jlab, using vncviewer on ifarm can be slow because it's
 +
 
 +
In principle, we don't need Xwindow forwarding to use vncviewer on ifarm. We could use a local vncviewer and ssh tunneling for better performance. This can be important if you are not on jlab internal network. ask me and I can write a howto if nessary

Revision as of 12:41, 12 March 2018

For any question, email Zhiwen Zhao zwzhao@jlab.org

Why

Usually we are running code on ifarm without caring about graphic because it's used for a test ground for farm job anyway.

Sometimes we do want to test a code's graphic feature. For example, it's a common system we all have access and can be used for debug.

Xwindow forwarding (not recommended)

One way to do it is simply use Xwindow forwarding by ssh into ifarm and run the code. but the problem is that Xwindow graphic is always rendered in your local machine. So not only the test can have different results for different people because their local machines are different. Sometimes, it can cause crash of your local machine if your code is not nice and your local machine is very different from ifarm.

if your local machine is linux or Mac which has Xwindows
ssh -XY your_lab_username@ifarm          (login with Xwindow forwarding enabled)
xclock &                                 (test if Xwindow forwarding works)                                            
If you local machine is windows, you need to enable Xwindows forwarding in putty option and have a Xwindow server like Xming-mesa running. 
then test if "xclock" works

vnc (recommended)

tested on ifarm1401 and ifarm1402 as of 2017/05

The better way to do it is through a vnc inside ifarm. This way the code won't crash because it runs within the same environment where it is compiled and everyone will see same result. Here is how to do it

ssh -XY your_lab_username@ifarm (login with Xwindow forwarding enabled,this is to use vncviwer)
mkdir .vnc
edit .vnc/xstartup with lines below
        #!/bin/sh
        xsetroot -solid grey
        vncconfig -iconic &
        xterm -geometry 160x50+10+10 -ls -title "$VNCDESKTOP Desktop" &
        metacity &
chmod 755 .vnc/xstartup
vncserver                           (start vnc server, give a password if running it first time, note the port number output on screen)
vncviewer localhost:1               (use other port number if not 1 in last step)
(now you are inside ifarm and an xterm is open for you to use)
( make sure to kill the server after you using it to free resource on ifarm, 
otherwise it will keep running even after you log out!)
vncserver -kill :1                  (note the space before colons)

ssh tunneling and vnc

If you computer is outside of jlab, using vncviewer on ifarm can be slow because it's

In principle, we don't need Xwindow forwarding to use vncviewer on ifarm. We could use a local vncviewer and ssh tunneling for better performance. This can be important if you are not on jlab internal network. ask me and I can write a howto if nessary