Showing posts with label sage. Show all posts
Showing posts with label sage. 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...