Changes between Version 1 and Version 2 of OsgVpbBuildEnvLinux


Ignore:
Timestamp:
Jul 31, 2010, 6:23:48 PM (14 years ago)
Author:
Torben Dannhauer
Comment:

preliminary

Legend:

Unmodified
Added
Removed
Modified
  • OsgVpbBuildEnvLinux

    v1 v2  
    11[[TracNav(TracNav/TOC)]]
    22
    3 = OSG & VPB Build Environment in Linux as Step-By-Step Tutorial =
     3= How to Setup OSG & VPB Build Environment in Linux as Step-By-Step Tutorial =
     4
     5
     6
     7= Tutorial how build OSG on Linux and render a OSG !VirtualPlanetBuilder database clustered =
     8
     9Basically it is possible to render virtualPlanetBuilder Databases on MS Windows and Linux. Unfortunately MS Windows is not stable enough, maybe caused by NTFS and the heavy systemload (RAM, CPU, HDD).
     10To render large databases, it is absolutely necessary to use VPB on linux.
     11
     12
     13= System installation and basic preparation ==
     14
     15* Install Kubuntu 9.10 64 bit (64 bit is important to prevent your system to crash due to some ressource limits)
     16* Activate proprietary video driver: Menu -> system -> driver.  --> reboot
     17* Link shell to desktop
     18* install basic packages
     19<code>
     20aptitude update
     21aptitude install vim
     22</code>
     23
     24=== Setup Raid, if nessecary ===
     25* Install package:
     26<code>
     27aptitude install dmraid
     28</code>
     29* Read in existing Windows or Linux raids and activate them
     30<code>
     31dmraid -r
     32dmraid -ay -v
     33</code>
     34* Add raids an windows Drives to fstab
     35<code>
     36mkdir /mnt/disk1
     37mkdir /mnt/disk2
     38
     39vim /etc/fstab
     40
     41dev/mapper/isw_befejdgeeb_Volume01     /mnt/disk2      auto    defaults        0       0
     42/dev/sda2                               /mnt/disk1      auto    defaults        0       0
     43</code>
     44lookup the devicename in /dev/mapper after the last dmraid command
     45
     46
     47
     48=== [Optional] Using Synergy to control the whole cluster with only one keyboard and mouse ===
     49* Install synergy
     50<code>
     51aptitude install synergy quicksynergy
     52</code>
     53
     54howto: http://www.mattcutts.com/blog/how-to-configure-synergy-in-six-steps/
     55
     56
     57== Compile and install OSG and its dependencies ==
     58
     59* Install osg-dependencies and osg like http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/Debian-Dependencies
     60Use this updated list which is adapted for kubuntu 9.10:
     61<code>
     62aptitude update
     63aptitude install cmake subversion g++ libx11-dev nvidia-glx-185-dev libglu-dev
     64aptitude install libpng-dev libjpeg-dev libtiff-dev libfreetype6-dev libgdal-dev gdal-bin
     65aptitude install libcurl4-dev dcmtk libdcmtk1-dev libgtk2.0-dev libxul-dev libpoppler-glib-dev
     66aptitude install libvncserver-dev librsvg2-dev libsdl-dev libxml2-dev
     67aptitude install xxdiff dos2unix libboost-regex doxygen graphviz subversion-tools
     68
     69</code>
     70To use the new introduced resume function, yu must use at least OSG 2.9.5 with VPB 0.9.11
     71Basically: VPB versions are bound to special OSG versions. (like 0.9.10 is bound to osg 2.8.2)
     72
     73* Compile OSG 2.9.5
     74<code>
     75cd /tmp
     76svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.5 OpenSceneGraph
     77cd OpenSceneGraph
     78./configure
     79make -j 8
     80make install
     81cd ..
     82</code>
     83
     84* ... or Compile newest OSG from SVN
     85<code>
     86cd /tmp
     87svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk OpenSceneGraph
     88cd OpenSceneGraph
     89./configure
     90make -j 8
     91make install
     92cd ..
     93</code>
     94
     95
     96
     97
     98* Add OSG environment variables to make all osg binaries callable via interactive shell:
     99<code>
     100vim /home/fsd/.bash_profile
     101export PATH=$PATH:/home/fsd/OpenSceneGraph/bin
     102export OSG_FILE_PATH=/home/fsd/sampledata/:/home/fsd/sampledata/Images
     103
     104vim /etc/bash.bashrc
     105export LD_LIBRARY_PATH=/home/fsd/OpenSceneGraph/lib/:/home/fsd/VirtualPlanetBuilder/lib/
     106</code>
     107reboot to load changes and allow VPB compiling.
     108
     109
     110* Compile VPB 0.9.11:
     111<code>
     112 svn checkout http://www.openscenegraph.org/svn/VirtualPlanetBuilder/tags/VirtualPlanetBuilder-0.9.11/ VirtualPlanetBuilder
     113 cd VirtualPlanetBuilder
     114./configure
     115make -j 8
     116make install
     117</code>
     118
     119* or Compile newest VPB from SVN:
     120<code>
     121 svn checkout http://www.openscenegraph.org/svn/VirtualPlanetBuilder/trunk VirtualPlanetBuilder
     122 cd VirtualPlanetBuilder
     123./configure
     124make -j 8
     125make install
     126</code>
     127
     128* Download Sampledata :
     129<code>
     130svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph-Data/tags/OpenSceneGraph-Data-2.8.0 sampledata
     131</code>
     132
     133* Configure ressource limits
     134<code>
     135sudo vim /etc/security/limits.conf
     136
     137# End of file
     138fsd  soft    nofile  65353
     139fsd  hard    nofile  65353
     140</code>
     141
     142
     143
     144== Cluster preparation ==
     145
     146
     147=== Requirements for successful use of the cluster ===
     148
     149* Source data must be available on all nodes under the identical path (best solution: local source data on each node located at the same path)
     150* Destination folder must be shared over any network file system and must be available on all nodes under the identical path. Easiest solution: sshfs)
     151* Compile-script must be called from the destination directory (because all tasks contain the "run-path", this must be accessible by the executing node -> "run-path" must be the shared destination folder).
     152
     153To fulfill this requirements, let's assume this setup:
     154* One node acts as server node and has the IP 192.168.0.55
     155* Two nodes act as client nodes and have the IPs 192.168.0.54 and 192.168.0.56
     156* sshfs is used as network filesystem
     157* the username on all nodes is fsd
     158* The destination folder for the compiled database is {{/geodata}}
     159* The local drive with geo source data is {{/localSourceData}}
     160
     161
     162To use vpbmaster clustered, all maschines must have access to the server node.
     163Open a fresh shell and typ in as standart user (NOT root!):
     164<code>
     165ssh-keygen -t rsa
     166<if asked for passphrase: Press enter for no passphrase - otherwise the login would not be passwordless :)>
     167
     168ssh-copy-id -i .ssh/id_rsa.pub fsd@192.168.0.55
     169</code>
     170
     171Because remote ssh commands do not invoke the environment settings of an interactive shell, ssh must be prepared to provide the required environment variables also for ssh non-interactive-shell:
     172{{vim /etc/ssh/sshd_config}}
     173<code>
     174PermitUserEnvironment yes
     175
     176vim /home/fsd/.ssh/environment
     177LD_LIBRARY_PATH=/home/fsd/OpenSceneGraph/lib/:/home/fsd/VirtualPlanetBuilder/lib/
     178OSG_FILE_PATH=/home/fsd/sampledata/:/home/fsd/sampledata/Images
     179</code>
     180
     181To share over network the destination folder to write the database in, install sshfs:
     182<code>
     183aptitude install sshfs
     184</code>
     185
     186Create Folder for the local source data and shared destination data
     187<code>
     188mkdir /mnt/disk3            # for source data
     189mkdir /geodata              # for destination data, shared over sshfs
     190</code>
     191
     192
     193
     194== Use Cluster ==
     195
     196=== Preparation after boot of all clients ===
     197* mount at the @@+++ server node @@  the destination harddrive into the appropriate folder:
     198<code>
     199mount /dev/sde1 /geodata
     200</code>
     201* mount on @@+++ all client nodes  @@ the destination directory of the server node over sshfs.
     202Let's assume the server has the IP 192.168.0.56:
     203<code>
     204sshfs fsd@192.168.0.56:/geodata /geodata
     205<enter password of the server node>
     206</code>
     207
     208
     209=== Create the compile script ===
     210
     211To allow easy recalls of the database build command, create a script:
     212{{vim /etc/geodata/compile_BRD_Sued.sh}}:
     213{{{
     214#!/bin/sh
     215
     216vpbmaster --machines machinepool.txt\
     217 --geocentric\
     218 --terrain\
     219 --compressed\
     220 -d /localSourceData/srtm-V4.2-europa\
     221 -t /localSourceData/Muenchen_25cm\
     222 -t /localSourceData/geocontent/Deutschland_1m/Sued\
     223 -t /localSourceData/bluemarble\
     224 -o /geoData/BRD1m_MUC0.25m_srtmEU_BM/terrain.ive
     225}}}
     226
     227
     228=== Compile Database ===
     229
     230If everything is setup correctly, the processing step ist very easy. Open an new shell on the server node and call as standard user (NOT ROOT!):
     231<code>
     232cd /geodata
     233./compile_BRD_SUED.sh
     234</code>
     235
     236While the database is creating, it is possible to watch the actual progress in another console. Because files are written and modified, the viewer application will give warnings or will terminate in few cases. This happens due to the creation progress and does not affect or modify the database, please ignore it.
     237After finished creation, this should not happen, of course ;)
     238
     239Because system load during database creation is very high, on some systems the operation system or the compile process crash.
     240If these crashes happens at the beginning of the rendering process, please check if your "openfile" limits are set correctly
     241
     242
     243=== Resume compiling database after crash ===
     244
     245See http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/Resume
     246
     247To resume the crashed compile process, execute on the server node:
     248<code>
     249cd /geodata
     250vpbmaster --machines machinepool.txt --tasks build_master.tasks
     251</code>
     252
     253Take care @@+++ NOT @@ to call the compile script again, in this case all compiled tasks will be resetted to status "pending"
     254
     255
     256
     257== Source data aquisition ==
     258
     259The following source data could be used:
     260* Digital Elevation Data
     261 * Free global elevation data with 3 arcs resolution: SRTM data (NASA)
     262 * Free local high resolution elevation models: DEM data (www.viewfinderpanoramas.org)
     263* Textures/Orthophotos
     264 * Free global low resolution texture data : Bluemarble Next Generation (NASA)
     265 * Free local low/medium resolution texture data: Landsat (NASA)
     266 * Commercial global medium/high resolution texture data: Landsat (atlogis.com, ...)
     267 * Commercial high resolution national texture data: e.g. Germany (Geocontent), USA (USGS), ...
     268
     269
     270=== SRTM-Data ===
     271
     272SRTM data with 3 arcs are available for free at
     273* http://www.csi.cgiar.org/index.asp (american server, very slow)
     274* ftp://xftp.jrc.it/pub/srtmV4/ (european mirror, very fast)
     275
     276Local high resolution DEM data (mainly based on SRTM)
     277* http://www.viewfinderpanoramas.org/dem3.html
     278
     279Tip:
     280Because SRTM data is delivery in many small .zip or tar.gz files, download and unpack it automatically:
     281<code>
     282wget -r ftp://xftp.jrc.it/pub/srtmV4/tiff/
     283for zipfile in *.zip;do unzip -o "$zipfile" -d unpacked; done
     284</code>
     285
     286
     287=== US texture data ===
     288
     289Local High and global resolution Texture and DEM data
     290* http://edcsns17.cr.usgs.gov/EarthExplorer/
     291* http://glovis.usgs.com
     292
     293To use LANDSAT arial images, read https://zulu.ssc.nasa.gov/mesid/tutorial/LandsatTutorial-V1.html for introduction. LANDSAT datasets are deliverey with up to seven images, each representing a different sensor with different wavelength. Three of this files (sensors for RGB) must be combined for the raw "natural" image.
     294
     295The image merging is possible with gdal_merge.py (available in FWTools):
     296<code>
     297gdal_merge.py -o outfile.tif R_sensor.tif  G_sensor.tif B_sensor.tif
     298</code>
     299
     300=== National high resolution data ===
     301
     302National high resolution data is available from many companies. Germany: !GeoContent
     303
     304
     305== compress Data ===
     306
     307To shift system load from HDD to CPU, compress all textures lossless with LZW. This will increase rendering time a lot, because usually the HDD ist the bottleneck.
     308{{{
     309gdal_translate -co "COMPRESS=LZW" unsw ToDo
     310}}}
     311
     312=== Moon Data ===
     313
     314To animate earth rising above moon horizon, it could be usefull to model the moon.
     315
     316http://lunar.arc.nasa.gov/dataviz/datamaps/index.html
     317
     318== Troubleshooting ==
     319
     320If compiling fails at the beginning:
     321* reboot
     322* Please check if you use a 64 bit operating system
     323* check your limits: {{limits -a}}
     324
     325If compiling fails after many hours or days:
     326* Maybe your OS runs out of any ressource, so reboot and resume (read above)
     327* Check your hardware if resuming do not help.
     328
     329If only local threads are executed, but no remote ones:
     330* Check your ssh setup, if you can login passwordless from the server node to the client nodes
     331* Check your ssh setup, if your environmental variables on the client nodes are available if you login to a client node