Showing posts with label Rocks. Show all posts
Showing posts with label Rocks. Show all posts

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

Thursday, 19 November 2009

Step by step guide for the installation and configuration of a cluster (with Rocks) to run ParaView

We have recently installed a small test cluster to run ParaView visualization software in parallel. The configuration was not trivial, and I put a detailed step-by-step guide in SIEpedia, in case it can be of interest to someone else. Any comments or suggestions are welcome.