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...

9 comments:

Unknown said...

Antes que nada un saludo Angel de Vicente, muy buenos post sobre TDW.

Estoy configurando un cluster de visualización, en tu experiencia que es mejor utilizar Cluster Rocks o Ubuntu ?

angelv said...

Hola José,

si funcionase bien, usar Rocks simplificaría mucho las cosas, pero yo nunca conseguí usar bien Chromium, y el SAGE que viene con el Roll Viz en la 5.3 no viene con algunas aplicaciones básicas (creo que es el imageviewer, por ejemplo).

Así que por éso lo estoy montando "a mano", para entender bien lo que es necesario. Por otro lado, la versión de Linux que viene con Rocks es algo antigua y no tiene tantos paquetes precompilados como Ubuntu, con lo que dependiendo de los programas que quieras correr, también ésto es una ventaja.

La verdad es que si tengo tiempo lo que me gustaría hacer una vez tenga bien entendido todo lo necesario para una buena configuración, sería crear mi propio roll de visualización para Rocks con todo bien configurado, pero éso de momento va a tener que esperar....

Saludos,

Unknown said...

Saludos Angel

Estoy probando con rocks, han surgido algunos problemas pero sigo investigando

angelv said...

Hola José,

OK, si consigues hacerlo funcionar bien, hazmelo saber. Yo ahora ya no estoy mirando Rocks, pero podría volver a estar interesado más adelante.

Saludos

Unknown said...

Q tal Angel, pues aquí probando ParaView en Rocks. solo que la imagen no se ve muy consistente por los bordes algún tip para configurar los atributos como viz_tile_resolution.

Otra pregunta, por el momento estoy probando con un layout de 2x3 (3 nodos c/u con 2 monitores), pero al probar un layout de 3x3 (4 nodos c/u con 2 monitores y el nodo Frontend 1 monitor en el layout y otro en el escritorio por asi decirlo) al probar esta ultima configuración no me funciona. es posible hacer esto ? El frontend con 2 monitores de los cuales uno pertenece al layout

angelv said...

Hola José,

para lo de los bordes, no sé si te entiendo bien, pero probablemente lo que te interese es la opción de hide_bezels (o algo parecido, mira la documentación).

Respecto a usar un monitor del frontend como parte del display, creo que con Rocks no se puede hacer (al menos no de una manera standard). Pero si haces el display wall "a mano", no hay ningún problema con ésto.

Saludos,

Andre B said...

Hace como un mes pedi ayuda en el foro de sagecommons.org, y de ahi encontre tu nombre, ya que pusiste una liga a tus intentos en tu blog. Ahora mismo instale xUbuntu 9.04 y ando intentando de nuevo. Llegue al punto donde pude correr ./sage y me dice que esta conectado a localhost... Pero cuando intento correr fsManager me aparece
can't read messages from fsManager
can't read messages from fsManager
can't read messages from fsManager
... (y continua repitiendo diciendo eso)

La pantalla negra aparece y todo pero no se que esperar.
Alguna ayuda?

Gracias de antemano,

angelv said...

Pudiste resolver ésto? Recién incorporado al trabajo después de las vacaciones y acabo de ver ésto.

Andre B said...

Si, lo que hice fue instalar xubuntu 9.04 y funciono. Todavia no se como usar video o algo asi pero por lo menos puedo extender imagenes en 2 computadoras.