Showing posts with label Dsiplay-wall. Show all posts
Showing posts with label Dsiplay-wall. Show all posts

Monday, 28 June 2010

SAGE + Chromium in my display wall

I have continued the configuration of my display wall (see my previous post).

Until now I had managed to get OpenGL applications working OK with Chromium, but only Chromium for the type of display wall that I envisage we need is not sufficient:
  • the main problem I found is that I cannot run two Chromium applications at the same time. Perhaps this is doable, but I didn't find how to do it.
  • applications cannot be moved around the display wall (there is a resizeable option with Chromium, but when I used it I got all sort of artifacts in the running application).
I also managed to get SAGE working fine, and the image viewer and the video viewer work fine (and you can easily move windows, rotate them, resize them, etc.), but OpenGL applications would need either tweaking the source code or either run them under the GL library wrapper (which according to its developer it has to be considered beta and is not recommended for production walls).

So I decided to check whether SAGE and Chromium can work fine, and I found that there is no problem with it. Something that I would like to work out is that I can still only run one application with Chromium. Other than that, the stuff started with SAGE can be moved, resized and rotated very easily, which is nice. The Chromium applications have a fixed position and size when I start them, but you can easily decide where and how big to start the application (see the two sizes of the Google Earth application in the video).

Running 32bits applications in Chromium while running 64bits SAGE is no problem (I just need to run the gl_32.sh script as seen in the previous post before launching the 32 bits app, and once it has started run gl_64.sh to get the library links back to normal).

For the size and the position of the Chromium applications, one can easily create a script with these data as input, and which creates a configuration file for Chromium which is used to launch the given application. Moving or resizing the application once it has started seems to give trouble.

A demo of this new setting can be found here.

Tuesday, 1 June 2010

Adding SAGE to my display wall

As a continuation to my work on a tiled display wall, here there are the steps taken to install SAGE: "a graphics streaming architecture for supporting collaborative scientific visualization environments with potentially hundreds of megapixels of contiguous display resolution". So far, the basics are installed correctly, some demo applications are working OK, plus imageviewer and VLC, though I'm having trouble with the VNCViewer... (I'll keep working on this).

We dowload the current source version sage3-03-24-09.tgz.

Before trying to compile SAGE, we need to make sure we get the prerequisites OK, which can be found at the SAGE Forum.

For SDL, we install via Synaptic Package Manager:libsdl1.2-dev; for readline, libreadline6-dev

And we will also need the packages libmagickwand-dev, portaudio19-dev, python-wxgtk2.8, libglew1.5-dev, python-numpy

QUANTA
======

We download the current version.


angelv@vaiven:~/Downloads$ tar -zxvf QUANTA-1.0.tar.gz
angelv@vaiven:~/Downloads$ cd QUANTA_1.0/
angelv@vaiven:~/Downloads/QUANTA_1.0$ mkdir QUANTA_build
angelv@vaiven:~/Downloads/QUANTA_1.0$ cd QUANTA_build/


(to get cmake and ccmake, I install the package cmake-curses-gui)


angelv@vaiven:~/Downloads/QUANTA_1.0/QUANTA_build$ ccmake ../


But the default version of g++ (4.4) will give errors like:
/home/angelv/Downloads/QUANTA_1.0/src/QUANTAdb_c.cxx:367: error: ‘memcpy’ was not declared in this scope

Since correcting this would need changing the source code, we go the easy route, and we are going to use a previous version of the compiler 4.2

So, in the cmake options I change:


CMAKE_CXX_COMPILER /usr/bin/g++-4.2
CMAKE_CXX_FLAGS -fPIC
QUANTA_BIN_TYPE 64

angelv@vaiven:~/Downloads/QUANTA_1.0/QUANTA_build$ make
angelv@vaiven:~/Downloads/QUANTA_1.0/QUANTA_build$ sudo make install


SAGE
====

angelv@vaiven:~/sage3.0$


Modify .bashrc and start a new shell


angelv@vaiven:~$ tail -n 4 .bashrc
export SAGE_DIRECTORY=$HOME/sage3.0
export PATH=${SAGE_DIRECTORY}/bin:${PATH}
export LD_LIBRARY_PATH=${SAGE_DIRECTORY}/lib:${LD_LIBRARY_PATH}


In src/Makefile:

QUANTA_DIR=/usr/local/include
QUANTA_CFLAGS=-I${QUANTA_DIR}/QUANTA -I${QUANTA_DIR}


(tips from http://www.vislab.uq.edu.au/research/optiportal/software/jaunty.html)
both in imgToDxt.cpp and imageviewer.cpp in the app/FileViewer/ImageViewer/ directory we change


#if MagickLibVersion >= 0x645
#define MagickGetImagePixels MagickGetAuthenticPixels
#endif


to

#if 0
#if MagickLibVersion >= 0x645
#define MagickGetImagePixels MagickGetAuthenticPixels
#endif
#endif


Now edit the sage3.0/config.mk file. Change the line:
ARCHITECTURE=$(shell uname -p)
to
ARCHITECTURE=$(shell uname -m)

Then, if running on amd64 architecture, change (at about line 97):
XLIBS=-L/usr/X11R6/lib64 -lGLU -lGL -lXmu -lXi -lXext -lX11
to
XLIBS=-L/usr/lib -lGLU -lGL -lXmu -lXi -lXext -lX11


angelv@vaiven:~/sage3.0$ make install (do not run make first!)


Now check the script named sage. The line in it which reads:
if [ `uname` == "Linux" ]
should be changed to:
if [ `uname` = "Linux" ]


Configuration of SAGE
---------------------

angelv@vaiven:~/sage3.0/bin$ head -n 1 /home/angelv/sage3.0/bin/fsManager.conf
fsManager vaiven 192.168.1.1 161.72.201.73


in fsManger.conf

tileConfiguration stdtile-2.angelv.conf



cat stdtile-2.angelv.conf:
TileDisplay
Dimensions 2 1
Mullions 0.625 0.625 0.625 0.625
Resolution 1280 2048
PPI 90
Machines 2

DisplayNode
Name dwall-11
IP 192.168.1.11
Monitors 1 (1,0)

DisplayNode
Name dwall-12
IP 192.168.1.12
Monitors 1 (0,0)



cat tileNodes.list
192.168.1.1
192.168.1.11
192.168.1.12


In the render nodes (so far dwall-11 and dwall-12) I do:

angelv@dwall-12:~$ sudo ln -s /home/angelv/sage3.0/lib/libquanta.so /usr/lib/


Test that it is working correctly:
(from the readme.txt file in sage distribution)


6. Test Whether SAGE is Working Properly
In $SAGE_DIRECTORY/bin
(1) Execute "fsManager". Tiled display becomes black if it runs correctly.
Users can specify a configuration file name as command-line argument.
Otherwise "fsManager.conf" is used.
(2) Open another terminal and execute "render"
(3) Open another terminal and execute "fsConsole"
(4) press TAB key twice. fsConsole commands are listed.
(5) ? or help command gives you short description for each command
(6) If you type initial character of a command and press TAB key,
the command is completed. Then, press TAB key again. You can see
the description of the command.
(7) move 0 1000 0 : move the app window


And I find no problems.

Test with the graphical interface
---------------------------------

angelv@vaiven:~/sage3.0/bin$ ./sage


after clicking start I get both monitors black and the interface to SAGE connection. I try to add a new server, and put the ports as default, host name "vaiven" and IP "192.168.1.1", but then when checking the info, it always tells me that the server is not running. Neverthelles, I put "connect as" angelv, then press connect. A message comes out saying: "Connection to sage server failed. Chat will be unavailable". Click OK and the SAGE UI comes out. I try to run "atlantis" but nothing happnes. By going to "Advanced Mode" in the SAGE Launcher window, and tab "Application Launcher" I see that it complains that cannot find atlantis. Sure enough, if I try to run atlantis like SAGE does it from the command line, then it does not find atlantis either:


angelv@vaiven:~/sage3.0/bin$ ssh 127.0.0.1 atlantis
bash: atlantis: command not found
angelv@vaiven:~/sage3.0/bin$


To solve it move the lines about SAGE binaries and libraries to the beginning of the .bashrc file (tip thanks to http://sayspy.blogspot.com/2006/10/anyone-know-how-to-get-sshbash-to-use.html)


angelv@vaiven:~$ head -n 10 .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

export SAGE_DIRECTORY=$HOME/sage3.0
export PATH=${SAGE_DIRECTORY}/bin:${PATH}
export LD_LIBRARY_PATH=${SAGE_DIRECTORY}/lib:${LD_LIBRARY_PATH}

# If not running interactively, don't do anything
[ -z "$PS1" ] && return
angelv@vaiven:~$


And now atlantis works without any trouble.

Applications that I want:
------------------------

* View images:

In the SAGE Launcher -> Advanced Settings, I open the Settings for the File Server, and type as Library Root /home/angelv/sage3.0/bin/file_library. Then, after starting SAGE, in the SAGE UI I go to Options-> File Library nad I Choose the "local" file library. Then, with Browse I select any image in my computer. Automatically is incorporated to the library, and I can select the images by (in the File Library - local user interface) opening the menu Files -> Image at the left. Clicking in Show will show the image in the display wall, and then I can resize it, move it, etc. from within the SAGE UI.

* Videos:

See http://www.vislab.uq.edu.au/research/optiputer/software/vlc/index.html


sudo apt-get install libhal-dev libmad0-dev libavcodec-dev libavformat-dev libswscale-dev libpostproc-dev libtwolame-dev liba52-dev libfribidi-dev libgcrypt-dev


Compile it with ./GO and copy it to the sage bin directory with
/bin/cp -r build/bin/vlc $SAGE_DIRECTORY/bin

Then, in the Advanced Mode -> File Server Settings -> File Types, type: vlc --vout sage
then, when selecting a video from the File Library, it displays without problems, with the sound going in the head node speakers. (I'm not sure if it is going also to the other nodes, since I don't have loudspeakers in them).

* Sharing the desktop

Install vnc4server xvnc4viewer

I run a VNC server


angelv@vaiven:~/sage3.0/bin$ vncserver -geometry 800x600


then connecting to it with the default vncviewer is no problem


angelv@vaiven:~/sage3.0/bin$ vncviewer vaiven:1


but if I try to run it with the provided VNC:


angelv@vaiven:~/sage3.0/bin$ ./VNCViewer 127.0.0.1 1 800 600 sagesage
inet_addr 127.0.0.1 = 16777343
VNC server supports protocol version 3.8 (viewer 3.3)
here
*** buffer overflow detected ***: ./VNCViewer terminated
======= Backtrace: =========




So, part is working, but I still need to iron out some problems. To be continued...

Monday, 24 May 2010

Settings for a Tiled Display Wall

As I wrote in a previous post I built a tiled display wall from "scratch". I haven't tried to streamline the process, so there is plenty of room for improvement, but I write here all the notes I took while building it.

My test setting involves 3 PCs and six monitors (two per PC). The "head" node has two network cards, one connected to the "outside" world and the other one connected to a Gigabit router. The "render" nodes only have one network card, connected to the router. The three PC's have NVidia cards.

I decide to give a try to the 9.10 Ubuntu distribution (64 bits), so the first thing is to install Karmic Koala in the head node (vaiven). After an installation without any issues, it is time to configure a few things. First, the network cards. eth1 is identified as the outside card, so I change the DHCP setting for it, and assign it a fixed IP address at our institution. To eth0 I also assign a fixed address (now for the internal network), with IP 192.168.1.1, netmask 255.255.255.0 (no gateway, DNS, etc.). In /etc/hosts I change the line

127.0.1.1 vaiven
to

192.168.1.1 vaiven


I do all the recommended updates (as per 18/5/2010), and install openssh-server, synergy, and emacs.

In the first render node I install Karmic Koala with automatic login. I decide that I'm going to call the render nodes as dwall-XY where X will be the row and Y the column. So, the first one is dwall-11, and the IP address (eth0) will be: 192.168.1.11, with gateway 192.168.1.1, DNS servers and search domains as per eth0 in vaiven.

After the initial installation I want to change some important things:

* In order to access the Internet from the render nodes (hints from http://www.cyberciti.biz/tips/linux-as-router-for-dsl-t1-line-etc.html), in vaiven I modify the file /etc/sysctl.conf so that it contains the line

net.ipv4.ip_forward = 1


And I also modify /etc/rc.local to change the firewall policies:

angelv@vaiven:~$ tail /etc/rc.local
## In order to enable or disable this script just change the execution# bits.
## By default this script does nothing.
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

exit 0
angelv@vaiven:~$


I restart vaiven, and test from dwall-11 that I can access the Internet. Then I also install all recommended updates (with the Update Manager), and I install openssh-server, synergy and emacs.

* A poor man's KVM

I only have one keyboard and a mouse, so I don't want to get up and change the USB connections all the time, and I don't want to buy a KVM, so I make sure that synergy is installed in both vaiven and dwall-11. I create the following config file in my home directory in vaiven

angelv@vaiven:~$ cat synergy.conf
section: screens
vaiven:
dwall-11:
end
section: links
vaiven:
left = dwall-11
dwall-11:
right = vaiven
end
angelv@vaiven:~$


I make sure that /etc/hosts in both machines have the lines
angelv@dwall-11:~$ cat /etc/hosts
127.0.0.1 localhost
192.168.1.1 vaiven
192.168.1.11 dwall-11[...]


And then I run:

angelv@vaiven:~$ synergys --config synergy.conf
angelv@dwall-11:~$ synergyc vaiven


With this I can move the mouse and use the keyboard in both computers without changing the USB connections.

I restart both computers and verify that dwall-11 logins automatically, that once synergys and synergyc are started I can move the mouse to dwall-11 and back to vaiven, and that I can access the Internet without problems from dwall-11.

One problem that I found with synergy is that some keys in my keyboard don't register (like th "ñ"), but for most purposes it works perfect.

* Share home folders in the cluster.

I install in vaiven nfs-kernel-server and modify the following files:


angelv@vaiven:~$ tail -n 5 /etc/exports
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/home 192.168.1.0/255.255.255.0(rw,sync)

angelv@vaiven:~$ tail -n 10 /etc/hosts.deny

# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

angelv@vaiven:~$ tail -n 10 /etc/hosts.allow
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#
portmap: 192.168.1.0/255.255.255.0
lockd: 192.168.1.0/255.255.255.0
mountd: 192.168.1.0/255.255.255.0
rquotad: 192.168.1.0/255.255.255.0
statd: 192.168.1.0/255.255.255.0
angelv@vaiven:~$


In dwall-11 I install nfs-common and modify the following files:


angelv@dwall-11:~$ tail -n 5 /etc/fstab
UUID=c9035fea-00c9-4fac-9c41-56409248ffd6 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=c00e80b8-af40-45dc-9516-3c0e80449848 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
192.168.1.1:/home /home nfs rw,hard,intr 0 0
angelv@dwall-11:~$


* Cluster shell environment
In order to be able to control all the computers from a single terminal I install Omnitty. For this I install in vaiven libncurses5-dev and then follow the instructions at http://omnitty.sourceforge.net/.

I also need to link a library file:

sudo ln -s /usr/local/lib/librote.so* /usr/lib/


In a terminal I change the Edit->Keyboard Shortcuts Help->Contents from F1 to Alt-Shift-F1 (since we will need F1 inside Omnitty) and then I create the file dwall

angelv@vaiven:~$ cat dwall
vaiven
dwall-11
angelv@vaiven:~$


With this, when I start Omnitty, by pressing F5 and then typing @dwall, a connection to all the machines in the cluster will be made.

Then, to avoid typing the password everytime I do:

angelv@vaiven:~$ ssh-keygen -t rsa
angelv@vaiven:~$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys


* Removing Ubuntu panels from view.
When displaying in the complete wall, we don't want to see the Ubuntu panels, so in vaiven I remove the panel on the bottom of the screen, and I change the properties in the top one to Autohide. Since this information is stored in the home directory, when I login again in dwall-11, these settings are replicated in there.

* In dwall-11 and vaiven I download and configure the NVidia drivers (System->Administration->Hardware drivers)

* I don't want the monitors in the display wall to go to sleep or to lock, so in dwall-11 in the Screensaver preferences I uncheck "Activate screensaver ..." and "Lock screen when screensaver..." and inside the Screensaver Preferences in Power Management I put "Never" in "Put display to sleep when inactive".


Chromium



It is now time to start configuring Chromium http://chromium.sourceforge.net/, so I download it from http://sourceforge.net/projects/chromium/files/ (version 1.9). The instructions for installation are at: http://chromium.sourceforge.net/doc/chromium2.html

I create two directories in my home to hold de 32 and 64 bits versions. First we go for the 64 version. I enter in cr-1.9, and to compile it we will need first a few things:


angelv@vaiven:~$ sudo ln -s /usr/bin/make /usr/bin/gmake

angelv@vaiven:~/cr-1.9$ sudo apt-get install libglut3-dev libglut g++ libxmu-headers libxmu-dev libjpeg-dev zlib1g-dev libxi-dev


Then, we just run make.

To compile the 32 bits version, I go into cr-1.9-32 and modify the file options.mk so that it contains the line:


FORCE_32BIT_ABI=1


We will need some extra packages (libc6-dev-i386, g++-multilib, ia32-libs and lib32z1-dev) and then we can just run make.

To make Chromium work fine, we need to create some files (for this I follow my previous post my previous post).


angelv@vaiven:~$ cat enable_cr
#!/bin/bash
cd /home/angelv/cr-1.9/lib/Linux
ln -s libcrfaker.so libGL.so.1
ln -s libcrfaker.so libGL.so

cd /home/angelv/cr-1.9-32/lib/Linux
ln -s libcrfaker.so libGL.so.1
ln -s libcrfaker.so libGL.so

angelv@vaiven:~$ cat disable_cr
#!/bin/bash
cd /home/angelv/cr-1.9/lib/Linux
rm libGL.so.1
rm libGL.so

cd /home/angelv/cr-1.9-32/lib/Linux
rm libGL.so.1
rm libGL.so

angelv@vaiven:~$ tail -n 10 .bashrc
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi


export PATH="/home/angelv/cr-1.9/bin/Linux:$PATH"
export LD_LIBRARY_PATH="/home/angelv/cr-1.9/lib/Linux:/home/angelv/cr-1.9-32/lib/Linux:$LD_LIBRARY_PATH"
export CRMOTHERSHIP="vaiven"

angelv@vaiven:~$ cat .crconfigs
* /home/angelv/first_angel.conf %p

angelv@vaiven:~$ cat first_angel.conf
import sys
sys.path.append('/home/angelv/cr-1.9/mothership/server')
from mothership import *

TILE_WIDTH = 1280
TILE_HEIGHT = 2048

appnode = CRApplicationNode('vaiven')
tilesortspu = SPU('tilesort')
appnode.AddSPU(tilesortspu)
appnode.Conf( 'show_cursor', 1 )
cr = CR()
cr.AddNode(appnode)

renderspu = SPU('render')
renderspu.Conf('fullscreen', 1)
#renderspu.Conf('window_geometry', [0, 0, 512, 512])
renderspu.Conf( 'show_cursor', 1 )

node = CRNetworkNode('dwall-11')
node.AddTile(0, 0, TILE_WIDTH, TILE_HEIGHT)
node.AddSPU(renderspu)
node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-11", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )

tilesortspu.AddServer(node, protocol='tcpip', port=7000)

cr.AddNode(node)

demo = sys.argv[1]

appnode.SetApplication(demo)

cr.Go()
angelv@vaiven:~$

angelv@vaiven:~$ cat start-crserver.sh
#!/bin/bash
export PATH="/home/angelv/cr-1.9/bin/Linux:$PATH"
export LD_LIBRARY_PATH="/home/angelv/cr-1.9/lib/Linux:/home/angelv/cr-1.9-32/lib/Linux:$LD_LIBRARY_PATH"

export DISPLAY=:$1
$2 -mothership $3:$4 -port $5
angelv@vaiven:~$


and in dwall-11 we install the necessary drivers:

angelv@dwall-11:~$ sudo apt-get install libgl1-mesa-dev


First, for testing, we try Chromium in just one PC (following its instructions:


% cd mothership/configs
% python crdemo.conf atlantis &
% crserver &
% crappfaker


and all is fine (when trying to run this in Ubuntu 10.04 we got problems like angelv@vaiven:~/cr-1.9/mothership/configs$ CR Warning(vaiven:14640): Render SPU: Display :0.0 doesn't have the necessary visual: RGB, Doublebuffer, Z)


Now it is time to try it properly.


angelv@vaiven:~$ ./enable_cr
angelv@vaiven:~$ glxgears
CR Warning(vaiven:22224): the OpenGL faker was loaded without crappfaker!
Defaulting to an application id of -1!
This won't work if you're debugging a parallel application!
In this case, set the CR_APPLICATION_ID_NUMBER environment
variable to the right thing (see opengl_stub/load.c)
CR Warning(vaiven:22224): Using Chromium configuration for * from /home/angelv/.crconfigs
This is Chromium, Version 1.9
Start a crappfaker on vaiven
Autostart for node dwall-11: ['/usr/bin/ssh', '-x', 'dwall-11', '/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000']
Mothership signalling spawning process 22224
CR Info(dwall-11:7033): Total output dimensions = (1280, 2048)
26 frames in 5.1 seconds
26 frames in 5.1 seconds
26 frames in 5.1 seconds
24 frames in 5.1 seconds
24 frames in 5.1 seconds
27 frames in 5.1 seconds


No problems, although it is very slow. To make it work properly, we need to go to Appearance -> Visual Effects, and select None (I do it for both vaiven and dwall-11). With this we are back in business and glxgears works perfectly.

I install in vaiven stellarium (sudo apt-get install stellarium) and works with Chromium without issues.

I try Google Earth (which I download from http://earth.google.com/). No trouble installing it by running the script (although it complains about the cache everytime I start it). To solve the complaining about the cache I have to do:

angelv@vaiven:~$ sudo chown -R angelv:angelv .config/Google/
angelv@vaiven:~$ grep home .config/Google/GoogleEarthPlus.conf
KMLPath=/home/angelv/.googleearth
CachePath=/home/angelv/.googleearth/Cache


Now, in order to run GoogleEarth with Chromium I have to first make a symbolic link and create a couple of files:


angelv@vaiven:~$ ls -lt /usr/lib/libGL.so.1_32
lrwxrwxrwx 1 root root 29 2010-05-20 13:26 /usr/lib/libGL.so.1_32 -> /usr/lib32/libGL.so.185.18.36
angelv@vaiven:~$

angelv@vaiven:~$ cat gl_32.sh
#!/bin/sh

sudo rm /usr/lib/libGL.so.1
sudo ln -s /usr/lib/libGL.so.1_32 /usr/lib/libGL.so.1

angelv@vaiven:~$ cat gl_64.sh
#!/bin/sh

sudo rm /usr/lib/libGL.so.1
sudo ln -s /usr/lib/libGL.so.1_64 /usr/lib/libGL.so.1
angelv@vaiven:~$


And then it runs without issues (except that the we have to turn off the Atmosphere effect).


angelv@vaiven:~$ sudo ./gl_32.sh
angelv@vaiven:~$ googleearth


Adding render nodes

The idea was to use SystemImager to replicate the render nodes, but I found some problems, so for the time being I do it manually and will try to later on figure out a better way of cloning the render nodes.


In dwall-11 I open Synaptic Package Manager and File-> Save Marking As -> (Save full state, not only changes) -> Save (for instance: dwall.packages)

I install a new node (dwall-12) with the Ubuntu 9.10 CD. And then I proceed as follows:

* Configure the network to be 192.168.1.12 (as per dwall-11)
* Copy /etc/hosts and make sure is the same in all the machines (with all the stuff until now).
* Copy to /etc/fstab the line to share the home
* Get the dwall.packages file. Open Synaptic Manager -> Read Markings (dwall.packages) -> Apply
* Wait and reboot dwall-12

After rebooting I need to change a few things in order to include fully the new node in the display wall:

* Modify the dwall file for Omnity
* Modify the synergy.conf file
* System -> Administration -> Hardware drivers (to activate the Nvidia driver) (and copy the xorg.conf file from vavien to dwall-12)

* Modify first_angel.conf

angelv@vaiven:~$ diff first_angel.conf first_angel.conf.ORIGINAL
21,35d20
< node.AddTile(1280, 0, TILE_WIDTH, TILE_HEIGHT)
< node.AddSPU(renderspu)
< node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-11", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )
<
< tilesortspu.AddServer(node, protocol='tcpip', port=7000)
<
< cr.AddNode(node)
<
<
< renderspu = SPU('render')
< renderspu.Conf('fullscreen', 1)
< #renderspu.Conf('window_geometry', [0, 0, 512, 512])
< renderspu.Conf( 'show_cursor', 1 )
<
< node = CRNetworkNode('dwall-12')
38c23
< node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-12", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )
---
> node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-11", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )
angelv@vaiven:~$


And all works excellently: glxgears, googleearth and stellarium. Googleearth working with the Atmosphere effect does not work (as expected).

Software to see images, and to watch videos

* For video, we can try VLC (as suggested in here), with its built-in wall filter. We install VLC (installation of packages always through omnitty, so that we keep all systems synchronized) and create two scripts:


angelv@vaiven:~$ cat vlc-wall_2x2.sh
#!/bin/sh

# cleanup
killall -9 vlc
ssh dwall-11 killall -9 vlc
ssh dwall-12 killall -9 vlc


vlc --aspect-ratio 5:4 --sout '#standard{scale=1,access=udp,mux=ts,dst=224.0.55.55:1234}' --ttl 1 $@ &
cvlc --novideo --vout dummy udp://@224.0.55.55 &


ssh dwall-12 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 0 --fullscreen --xvideo-xineramascreen 0 udp://@224.0.55.55' &

ssh dwall-12 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 2 --fullscreen --xvideo-xineramascreen 1 udp://@224.0.55.55' &

ssh dwall-11 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 1 --fullscreen --xvideo-xineramascreen 0 udp://@224.0.55.55' &

ssh dwall-11 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 3 --fullscreen --xvideo-xineramascreen 1 udp://@224.0.55.55' &


angelv@vaiven:~$ cat vlc-wall-kill.sh
#!/bin/sh

# cleanup
killall -9 vlc
ssh dwall-11 killall -9 vlc
ssh dwall-12 killall -9 vlc

angelv@vaiven:~$


I also modify the file /etc/rc.local and add the line

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0


I reboot, I open VLC and do "Reset Preferences" and then to watch a video in the 4 monitors we just run the following (when trying to extend it to three computers it does not work OK. The image is shown, but the scales in each of the monitors is different. Apparently this is a known bug, so we should investigate more):


angelv@vaiven:~$ ./vlc-wall_2x2.sh


and when we are done

angelv@vaiven:~$ ./vlc-wall-kill.sh



* For an image viewer we are going to try the TerraServer Blaster

In order to compile it we install an old version of the g++ compiler (g++-4.2), which also installs libstdc++6-4.2-dev (otherwise, when compiling, it complains about not finding iostream.h), we also install the package libfltk-dev, and then change the compiler line in the Makefile to make use of g++-4.2, and then we just run make, which does its thing without problems:


angelv@vaiven:~/tsb-1.3$ file tsb
tsb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
angelv@vaiven:~/tsb-1.3$


After enabling Chromium (/home/angelv/enable_cr) TSB works perfectly. The program comes with a nice demo to verify that all is working, which we can call with:

angelv@vaiven:~/tsb-1.3$ ./tsb config-HiRISE.txt


With this in place, and after installing with the package manager Stellarium, Celestia and Paraview we have all we need for the moment working fine, as can be seen in this demo.

Monday, 3 May 2010

Settings for "FlightGear in a testing 2x3 display wall"

Let's explain here what I did in order to get my testing 2x3 display wall working (as seen in FlightGear in a testing 2x3 display wall).

I've got 3 PC's in typical cluster configuration (one of them acting as a head node with two ethernet cards: one to the outside world and the other one to the internal network, via a Gigabit switch; the other two PC's are just connected to the internal network), although this should not matter for the FlightGear configuration. All 3 PC's are running Ubuntu Karmic (9.10). For some reason, the sound in FlightGear was not behaving properly, so in my home directory I had to create the file ".alsoftrc" as follows (http://www.flightgear.org/forums/viewtopic.php?f=2&t=6291):


angelv@vaiven:~$ cat .alsoftrc
drivers = oss
angelv@vaiven:~$


Each PC controls two monitors (a column in the picture in FlightGear in a testing 2x3 display wall). So first I had to deal with using both monitors. I use Nvidia drivers, and I'm using Twinview, but this has the problem that in some window managers, when you maximize a window, it will only expand as to occupy one of the monitors, so I changed to TWM, a very basic window manager, but when you run FlightGear in fullscreen mode, it will occupy all the available space (both monitors). With this, it is now just a matter of creating an appropriate XML file which will describe the views that I want in each of the monitors. For the central column I want the cockpit view and the helicopter view. For this I got my configuration file as:


angelv@vaiven:~$ cat fgfs-config
<PropertyList>
  <sim>
    <rendering>
      <camera-group>
        <window>
          <name>wide</name>
          <host-name type="string"></host-name>
          <display>0</display>
          <screen>0</screen>
          <width>1280</width>
          <height>2048</height>
          <decoration type = "bool">false</decoration>
        </window>
        <camera>
          <window>
            <name>wide</name>
          </window>
          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1280</width>
            <height>1024</height>
          </viewport>
          <view>
            <heading-deg type = "double">0</heading-deg>
          </view>
          <frustum>
            <top>0.133</top>
            <bottom>-0.133</bottom>
            <left>-.1668</left>
            <right>.1668</right>
            <near>0.25</near>
            <far>120000.0</far>
          </frustum>
        </camera>
        <camera>
          <window>
            <name type="string">wide</name>
          </window>
          <viewport>
            <x>0</x>
            <y>1024</y>
            <width>1280</width>
            <height>1024</height>
          </viewport>
          <view>
            <heading-deg type = "double">0</heading-deg>
        <z>20</z>
          </view>
          <frustum>
            <top>0.133</top>
            <bottom>-0.133</bottom>
            <left>-.1668</left>
            <right>.1668</right>
            <near>0.4</near>
            <far>120000.0</far>
          </frustum>
        </camera>
        <gui>
          <window>
            <name type="string">wide</name>
          </window>
        </gui>
      </camera-group>
    </rendering>
  </sim>
</PropertyList>
angelv@vaiven:~$



For the right and the left columns I want basically the same view (though viewed from an angle as we will see later), but I also wanted to point the camera in the upper row a little bit lower (which can be useful to appreciate landings), so I created another XML file, basically the same as above, but displacing the camera a little bit:


angelv@vaiven:~$ diff -C 5 fgfs-config fgfs-config.sides
*** fgfs-config    2010-04-29 14:48:43.112948642 +0100
--- fgfs-config.sides    2010-04-29 15:16:40.880449639 +0100
***************
*** 44,53 ****
--- 44,54 ----
              <height>1024</height>
            </viewport>
            <view>
              <heading-deg type = "double">0</heading-deg>
          <z>20</z>
+         <y>-3</y>
            </view>
            <frustum>
              <top>0.133</top>
              <bottom>-0.133</bottom>
              <left>-.1668</left>
angelv@vaiven:~$


Once this is in place, I checked the FlightGear documentation and this document to make a multiple computer setting. At the end, it all came to creating this script:


angelv@vaiven:~$ cat fgfs-wall.sh
#!/bin/sh

killall -9 fgfs
ssh dwall-0 killall -9 fgfs
ssh dwall-1 killall -9 fgfs

ssh dwall-0 'fgfs --config=/home/angelv/fgfs-config --prop:/sim/menubar/visibility=false --enable-hud --enable-fullscreen --timeofday=noon --native-fdm=socket,out,60,vaiven,5500,udp --native-fdm=socket,out,60,dwall-1,5501,udp --native-ctrls=socket,out,60,vaiven,5600,udp --native-ctrls=socket,out,60,dwall-1,5601,udp --prop:/sim/view[0]/config/heading-offset-deg=-10&'  &

ssh dwall-1 fgfs --config=/home/angelv/fgfs-config.sides --prop:/sim/menubar/visibility=false --enable-hud --enable-fullscreen --timeofday=noon --fdm=null --native-fdm=socket,in,60,,5501,udp --native-ctrls=socket,in,60,,5601,udp --prop:/sim/view[0]/config/heading-offset-deg=70&

fgfs --config=/home/angelv/fgfs-config.sides --prop:/sim/menubar/visibility=false --enable-hud --enable-fullscreen --timeofday=noon --fdm=null --native-fdm=socket,in,60,,5500,udp --native-ctrls=socket,in,60,,5600,udp --prop:/sim/view[0]/config/heading-offset-deg=-80 &

angelv@vaiven:~$


I run this in "vaiven" (which is my cluster head node, and controlling the right column of monitors). dwall-0 is the centre column, and where I run the "controller" FlightGear. I'm sure this can be done much better, but this was just a quick hack to get it working in my 2x3 display wall. Any comments on how to improve this configuration are wellcome.

By the way, my keyboard and mouse are connected (for "historical" reasons) to vaiven, the computer in the right column of monitors, but I want to control FlightGear from the monitor in the centre column of the display wall. This is very easily done by using Synergy

Friday, 30 April 2010

FlightGear in a testing 2x3 display wall.

FlightGear's support for multiple computers and multiple cameras is impressive. As a test, I managed to run FlightGear in a 2x3 display wall. One of the rows shows the view from the cockpit, while the other row shows views of the plane from outside at different angles. This was pretty easy to set up, although I didn't bother to align the monitors or the cameras very carefully. This is running in 3 PCs. Each PC controls two monitors (one column) with NVidia drivers and Twinview. Hopefully I will post the details next week...

Sunday, 25 April 2010

2x2 Demo Tiled Display Wall

I wrote in a previous post about my experience with the Viz roll and Rocks Cluster in order to get a tiled display wall. Since that looked like quite a lot of work, I decided to start afresh, and build a tiled display wall from "scratch" (i.e. without the help of the Viz roll), so that I could better control all the process. During this week I hope to do a write-up of what I did, but for the moment I recorded a mini-demo of the wall, which can be seen at Vimeo.

Wednesday, 7 April 2010

Hack to get Chromium working with Rocks 5.3

Rocks is "an open-source Linux cluster distribution that enables end users to easily build computational clusters, grid endpoints and visualization tiled-display walls".

Recently I've been using it to get a tiled-display wall, but found that it was not working as expected. Some software that it is supposed to come with SAGE is not there, and Chromium is not working except for the simplest of applications (I only managed to get it working with glxgears). A fix to the Viz Roll is coming, but in the meantime I figured how to get it working by installing my own version of Chromium. Since I've been asked to share this, I put these quick notes here (please let me know if something is not working or something is missing, so I can improve them) in case it can be of interest to anyone, but remember that this is just a quick hack. Hopefully a patched version of the Viz roll will be available soon.

For my setting I have four monitors and two nodes.
I created the file layout.xml:

<wall>
               <col>
                       <display>tile-0-0:0.0</display>
               </col>
               <col>
                       <display>tile-0-0:0.1</display>
               </col>
               <col>
                       <display>tile-0-1:0.0</display>
               </col>
               <col>
                       <display>tile-0-1:0.1</display>
               </col>
</wall>


With this, in simple mode I got glxgears working OK, but when I tried to run anything else (I tried with Stellarium), I get messages like:

CR Warning(tile-0-0:18331): __tcpip_read_exact() error: Bad address
CR Warning(tile-0-0:18331): Bad juju: 10485760 197100 on socket 0xc
CR Warning(tile-0-0:18331): CRServer: Last client disconnected - exiting.

Hence this hack... The Viz roll is supposed to work in mode=simple for Chromium and mode=meta for SAGE. I didn't want to have to change the mode, so I did the following to have Chromium working in mode=meta.

[root@vaiven ~]# rocks remove tile
[root@vaiven ~]# rocks add tile layout layout.xml
[root@vaiven ~]# rocks sync tile mode=meta

I downloaded Google Earth (32 bits application), installed the library dependencies and made sure that it was working OK when Chromium was disabled. The it was a matter of downloading Chromium and compiling both the 32 bits and the 64 bits versions (I put copies in my home directory, at /home/angelv/cr-1.9 and /home/angelv/cr-1.9-32).

Then I created two scripts, to enable and disable my Chromium:

[angelv@vaiven ~]$ cat enable_cr
#!/bin/bash
cd /home/angelv/cr-1.9/lib/Linux
ln -s libcrfaker.so libGL.so.1
ln -s libcrfaker.so libGL.so

cd /home/angelv/cr-1.9-32/lib/Linux
ln -s libcrfaker.so libGL.so.1
ln -s libcrfaker.so libGL.so

[angelv@vaiven ~]$ cat disable_cr
#!/bin/bash
cd /home/angelv/cr-1.9/lib/Linux
rm libGL.so.1
rm libGL.so

cd /home/angelv/cr-1.9-32/lib/Linux
rm libGL.so.1
rm libGL.so
[angelv@vaiven ~]$


and added PATH and LD_LIBRARY_PATH stuff to my .bashrc:

export PATH="/home/angelv/cr-1.9/bin/Linux:$PATH"
export LD_LIBRARY_PATH="/home/angelv/cr-1.9/lib/Linux:/home/angelv/cr-1.9-32/lib/Linux:$LD_LIBRARY_PATH"


I also had to change the .crconfigs file in my home directory, so that it will take my own Chromium configuration file:

[angelv@vaiven ~]$ cat .crconfigs
old-rocks* /opt/rocks/bin/rocks start chromium %p %m
* /home/angelv/first_angel.conf %p
[angelv@vaiven ~]$

And I created the file /home/angelv/first_angel.conf as shown below. Note that this file has a hard-coded configuration for my two compute nodes in meta mode, and that the node.AutoStart stuff has been changed, since for some reason launching the crserver via ssh gave the errors mentioned above. In its place I created a basic start-crserver.sh which is also included below.

[angelv@vaiven ~]$ cat first_angel.conf
import sys
sys.path.append('/home/angelv/cr-1.9/mothership/server')
from mothership import *

TILE_WIDTH = 2560
TILE_HEIGHT = 1024

appnode = CRApplicationNode('vaiven.ll.iac.es')
tilesortspu = SPU('tilesort')
appnode.AddSPU(tilesortspu)
appnode.Conf( 'show_cursor', 1 )
cr = CR()
cr.AddNode(appnode)

renderspu = SPU('render')
renderspu.Conf('fullscreen', 1)
#renderspu.Conf('window_geometry', [0, 0, 512, 512])
renderspu.Conf( 'show_cursor', 1 )


node = CRNetworkNode('tile-0-0.local')
node.AddTile(0, 0, TILE_WIDTH, TILE_HEIGHT)
node.AddSPU(renderspu)
#node.AutoStart( ["/usr/bin/ssh","tile-0-0", "DISPLAY=:0.0 /bin/sh -c
'/home/angelv/cr-1.9/bin/Linux/crserver -mothership vaiven:10000 -port 7000'"] )
node.AutoStart( ["/usr/bin/ssh",'-x',"tile-0-0", "/home/angelv/start-crserver.sh
0.0 crserver vaiven 10000 7000"] )

tilesortspu.AddServer(node, protocol='tcpip', port=7000)

cr.AddNode(node)

renderspu = SPU('render')
renderspu.Conf('fullscreen', 1)
#renderspu.Conf('window_geometry', [0, 0, 512, 512])
renderspu.Conf( 'show_cursor', 1 )

node = CRNetworkNode('tile-0-1.local')
node.AddTile(2560, 0, TILE_WIDTH, TILE_HEIGHT)
node.AddSPU(renderspu)
#node.AutoStart( ["/usr/bin/ssh","tile-0-1", "DISPLAY=:0.0 /bin/sh -c
'/home/angelv/cr-1.9/bin/Linux/crserver -mothership vaiven:10000 -port 7000'"] )
node.AutoStart( ["/usr/bin/ssh",'-x',"tile-0-1", "/home/angelv/start-crserver.sh
0.0 crserver vaiven 10000 7000"] )
#node.AutoStart( ["/usr/bin/ssh",'-x',"tile-0-1", "start-crserver.sh 0.0
/home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000"] )

tilesortspu.AddServer(node, protocol='tcpip', port=7000)

cr.AddNode(node)
demo = sys.argv[1]

appnode.SetApplication(demo)


cr.Go()
[angelv@vaiven ~]$

[angelv@vaiven ~]$ cat start-crserver.sh
#!/bin/bash
export DISPLAY=:$1
$2 -mothership $3:$4 -port $5


[angelv@vaiven ~]$

With these modifications, after running enable_cr, Google Earth (32 bits), atlantis (64 bits) and Stellarium (64 bits) were fine.

These were quick notes that I took while I was doing the modifications, so most probably something is missing. If you find something missing, please let me know. For the time being I'm trying another software stack for the display wall, so I'm not planning on improving this, but I might come back to the Viz Roll in the near future...