Re: Cannot display on app node with image reassembly template

Eric Sandall <[email protected]>
Newsgroups gmane.comp.graphics.chromium.user
Message-ID <Pine.LNX.4.64.0605241220390.364@cerberus>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 24 May 2006, Brian Paul wrote:
> Eric Sandall wrote:
>> I used configtool.py to setup an Image Reassembly template (modified
>> to use ssh instead of rsh). When I run my config (vrcim-cluster.conf)
>> a render window appears on all of the render nodes (slave1 through
>> slave4) with part of the blue screen (trying to run `atlantis`)
>> displayed. The app node (vr-master) has a "GLUT Atlantis Demo" window
>> open, but does not seem to display the Atlantis window that I see when
>> running `python crdemo.conf atlantis` (which works). The render
>> windows on the slaves is static (solid blue, no whales).
>>
>> Any ideas? I've attached my options.mk that I used to compile chromium
>> 1.8 and my vrcim-cluster.conf.
>>
>> In case it matters (perhaps I'm using the wrong template ;)) I am
>> trying to use the slaves to do the 'work' of rendering, but have it
>> display on the master (which can also do the work, but is not
>> currently setup to do that with this configuration, AFAIK).
>
> Two quick suggestions:
>
> 1. Does the reassemble.conf example work for you?

Yes, if I modify it for my setup it will show render windows on all 4
slaves and properly display on the master node.

Note that if a screensaver is running on a slave node then the
appropriate tile on the master node will be blank. ;)

> 2. Could you try the latest Chromium 1.9 release candidate?
> http://chromium.sf.net/beta

reassemble.conf runs fine (ServerHosts='slave') on slave1 and slave2
while displaying on vr-master (once the screensavers were turned off,
anyways ;)).

I generated a new vrcim-cluster.conf with configtool.py. A few notes:
* There should be an option to specify the connection command (e.g.
   rsh or ssh)
* AUTO_START_APPS: explicitly uses /usr/local/bin/bin rather than
   crbindir
   e.g.:
 		if AUTO_START_APPS:
 			clientnode.AutoStart( ["/bin/sh", "-c",
 					"LD_LIBRARY_PATH=%s /usr/local/bin/crappfaker" %
crlibdir] )

Should be:
 		if AUTO_START_APPS:
 			clientnode.AutoStart( ["/bin/sh", "-c",
 					"LD_LIBRARY_PATH=%s %s/crappfaker" %
(crlibdir, crbindir) ] )

I have been manually changing these in my generated config files
(including the attached).

Trying the attached vrcim-cluster.conf (which was generated with
configtool.py using the Image Reassembly template) still gives a
static blue screen on the render nodes (slave1 through slave4) and a
blank "GLUT Atlantis Demo" window on the master (vr-master).

The attached vrcim-reassemble.conf has been modified to do what I was
hoping the configtool.py generated vrcim-cluster.conf would do. :)

- -sandalle

- --
Eric Sandall                     |  Source Mage GNU/Linux Developer
[email protected]                  |  http://www.sourcemage.org/
http://eric.sandall.us/          |  SysAdmin @ Inst. Shock Physics @ WSU
http://counter.li.org/  #196285  |  http://www.shock.wsu.edu/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEdLosHXt9dKjv3WERAhjrAJ42PR448Wccgllp9IauIuQfNmUD2wCgwywN
puh+EE/P3/dMU9Qsu3fU3e8=
=ODiI
-----END PGP SIGNATURE-----
vrcim-cluster.conf (text/plain, 10.1 KB)
TEMPLATE = "Image Reassembly"

import string, sys, getopt
sys.path.append( "../server" )
from mothership import *
import tilelayout

HIDDEN = 0

NUM_SERVERS = 4
TILE_ROWS = 4
TILE_COLS = 5
TILE_WIDTH = 256
TILE_HEIGHT = 256
LAYOUT = 0
SERVER_HOSTS = [u'slave1', u'slave2', u'slave3', u'slave4']
SERVER_PATTERN = (u'slave#', 1)
NUM_APP_NODES = 1
DYNAMIC_SIZE = 0
REASSEMBLY = 0
REASSEMBLE_HOST = "vr-master"
TILESORT_OPTIONS = [
	("bucket_mode", "Test All Tiles"),
	("scale_to_mural_size", 1),
	("fake_window_dims", [TILE_COLS * TILE_WIDTH, TILE_ROWS * TILE_HEIGHT]),
	("retile_on_resize", 1),
	("scale_images", 1),
	("sync_on_swap", 1),
	("sync_on_finish", 1),
	("split_begin_end", 1),
	("use_dmx", 0),
	("draw_bbox", 0),
	("bbox_line_width", 5),
	("bbox_scale", 1.0),
	("auto_dlist_bbox", 0),
	("lazy_send_dlists", 0),
	("dlist_state_tracking", 0),
	("emit_GATHER_POST_SWAPBUFFERS", 0),
	("local_tile_spec", 0),
	("stereo_mode", "None"),
	("glasses_type", "RedBlue"),
	("force_quad_buffering", 0),
	("render_to_crut_window", 0),
	("track_window_position", 0),
	("display_string", "DEFAULT"),
]
READBACK_OPTIONS = [
	("extract_depth", 0),
	("extract_alpha", 0),
	("local_visualization", 1),
	("visualize_depth", 0),
	("gather_url", ""),
	("gather_mtu", 1048576),
	("draw_offset", [0, 0]),
	("read_size", [0, 0]),
	("draw_bbox_outlines", 0),
	("title", "Chromium Readback SPU"),
	("window_geometry", [0, 0, 400, 400]),
	("fullscreen", 1),
	("resizable", 1),
	("on_top", 0),
	("borderless", 0),
	("default_visual", "rgb, double, depth"),
	("try_direct", 1),
	("force_direct", 0),
	("render_to_app_window", 0),
	("render_to_crut_window", 0),
	("show_cursor", 0),
	("system_gl_path", ""),
	("display_string", "DEFAULT"),
	("gather_url", ""),
	("gather_userbuf_size", 0),
	("lut8", ""),
	("swap_master_url", ""),
	("is_swap_master", 0),
	("num_swap_clients", 1),
	("use_osmesa", 0),
	("nv_swap_group", 0),
	("ignore_papi", 0),
	("ignore_window_moves", 0),
	("pbuffer_size", [0, 0]),
	("use_glxchoosevisual", 1),
]
REASSEMBLE_OPTIONS = [
	("title", "Chromium Render SPU"),
	("window_geometry", [0, 0, 256, 256]),
	("fullscreen", 1),
	("resizable", 1),
	("on_top", 0),
	("borderless", 0),
	("default_visual", "rgb, double, depth"),
	("try_direct", 1),
	("force_direct", 0),
	("render_to_app_window", 1),
	("render_to_crut_window", 0),
	("show_cursor", 0),
	("system_gl_path", ""),
	("display_string", "DEFAULT"),
	("gather_url", ""),
	("gather_userbuf_size", 0),
	("lut8", ""),
	("swap_master_url", ""),
	("is_swap_master", 0),
	("num_swap_clients", 1),
	("use_osmesa", 0),
	("nv_swap_group", 0),
	("ignore_papi", 0),
	("ignore_window_moves", 0),
	("pbuffer_size", [0, 0]),
	("use_glxchoosevisual", 1),
]
SERVER_OPTIONS = [
	("optimize_bucket", 1),
	("lighting2", 0),
	("only_swap_once", 0),
	("spu_dir", ""),
	("debug_barriers", 0),
	("shared_display_lists", 1),
	("shared_texture_objects", 1),
	("shared_programs", 1),
	("shared_windows", 0),
	("use_dmx", 0),
	("vertprog_projection_param", ""),
	("stereo_view", "Both"),
	("view_matrix", [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
	("right_view_matrix", [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
	("projection_matrix", [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
	("right_projection_matrix", [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
]
APP_OPTIONS = [
	("application", "atlantis -s 100"),
	("zeroth_arg", ""),
	("start_dir", "/home/chromium/cr-1.8/bin/Linux"),
	("client_dll", ""),
	("spu_dir", ""),
	("minimum_window_size", [0, 0]),
	("match_window_title", ""),
	("track_window_size", 1),
	("track_window_position", 1),
	("track_window_visibility", 1),
	("show_cursor", 0),
	("ignore_freeglut_menus", 1),
	("force_pbuffers", 0),
]
MOTHERSHIP_OPTIONS = [
	("MTU", 1048576),
	("auto_start", 1),
	("auto_start_apps", 1),
	("autostart_branches", 1),
	("autostart_max_nodes_per_thread", 1),
]
# end of options, the rest is boilerplate (do not remove this line!)

TILES = [[(0, 0, 256, 256), (1024, 0, 256, 256), (768, 256, 256, 256), (512, 512, 256, 256), (256, 768, 256, 256)], [(256, 0, 256, 256), (0, 256, 256, 256), (1024, 256, 256, 256), (768, 512, 256, 256), (512, 768, 256, 256)], [(512, 0, 256, 256), (256, 256, 256, 256), (0, 512, 256, 256), (1024, 512, 256, 256), (768, 768, 256, 256)], [(768, 0, 256, 256), (512, 256, 256, 256), (256, 512, 256, 256), (0, 768, 256, 256), (1024, 768, 256, 256)]]

def Usage():
	print "Usage:"
	print "  %s [--help] [-c columns] [-r rows] [-w tileWidth]" % sys.argv[0]

	print "     [-h tileHeight] [-l layout] [-d dynamicResize] [-s servers] [program]"
	print "Where layout is 0, 1 or 2"
	print "Where dynamicSize is 0, 1 or 2"
	sys.exit(0)


PROGRAM = ""
ZEROTH_ARG = ""
AUTO_START_SERVERS = 0
AUTO_START_APPS = 0


# Look for some special options
for (name, value) in APP_OPTIONS:
	if name == "application":
		PROGRAM = value
	elif name == "zeroth_arg":
		ZEROTH_ARG = value
for (name, value) in MOTHERSHIP_OPTIONS:
	if name == "auto_start":
		AUTO_START_SERVERS = value
	elif name == "auto_start_apps":
		AUTO_START_APPS = value

# Process command line args
try:
	(opts, args) = getopt.getopt(sys.argv[1:], "c:r:w:h:l:s:d:", ["help"])
except getopt.GetoptError:
	Usage()

for (name, value) in opts:
	if name == "--help":
		Usage()
	elif name == "-c":
		TILE_COLS = int(value)
	elif name == "-r":
		TILE_ROWS = int(value)
	elif name == "-w":
		TILE_WIDTH = int(value)
	elif name == "-h":
		TILE_HEIGHT = int(value)
	elif name == "-s":
		SERVER_HOSTS = str.split(value, ",")
	elif name == "-l":
		LAYOUT = int(value)
	elif name == "-d":
		DYNAMIC_SIZE = int(value)

if len(args) > 0:
	PROGRAM = args[0]

print "--- Image Reassembly Template ---"
print "Mural size: %d cols x %d rows" % (TILE_COLS, TILE_ROWS)
print "Tile size: %d x %d" % (TILE_WIDTH, TILE_HEIGHT)
print "Total size: %d x %d" % (TILE_WIDTH * TILE_COLS, TILE_HEIGHT * TILE_ROWS)
print "Layout mode: %s" % ["Raster", "ZigZag", "Spiral"][LAYOUT]
print "Dynamic size: %s" % ["No", "Yes (variable rows/cols)", "Yes (variable tiel size)"][DYNAMIC_SIZE]
print "Servers: %s" % SERVER_HOSTS
print "Program: %s" % PROGRAM
print "---------------------------------"


def LayoutTiles(muralWidth, muralHeight):
	if DYNAMIC_SIZE == 1:
		# variable rows/cols, fixed tile size
		tileWidth = TILE_WIDTH
		tileHeight = TILE_HEIGHT
		rows = 0
		cols = 0
	else:
		# fixed rows/cols, variable tile size
		assert DYNAMIC_SIZE == 2
		tileWidth = 0
		tileHeight = 0
		rows = TILE_ROWS
		cols = TILE_COLS

	if LAYOUT == 0:
		tiles = tilelayout.LayoutRaster(muralWidth, muralHeight,
										NUM_SERVERS,
										tileWidth, tileHeight,
										rows, cols)
	elif LAYOUT == 1:
		tiles = tilelayout.LayoutZigZag(muralWidth, muralHeight,
										NUM_SERVERS,
										tileWidth, tileHeight,
										rows, cols)
	else:
		tiles = tilelayout.LayoutSpiral(muralWidth, muralHeight,
										NUM_SERVERS,
										tileWidth, tileHeight,
										rows, cols)
	return tiles


localHostname = os.uname()[1]

cr = CR()

tilesortSPUs = []
clientNodes = []

if HIDDEN:
	hiddenline_spu = SPU('hiddenline')
	hiddenline_spu.Conf('line_width', 1)

for i in range(NUM_APP_NODES):
	tilesortspu = SPU('tilesort')
	for (name, value) in TILESORT_OPTIONS:
		tilesortspu.Conf( name, value )
	if DYNAMIC_SIZE:
		tilesortspu.TileLayoutFunction(LayoutTiles)
		tilesortspu.Conf('optimize_bucket', 0)
	tilesortSPUs.append(tilesortspu)

	clientnode = CRApplicationNode()
	if HIDDEN:
		clientnode.AddSPU(hiddenline_spu)

	clientnode.AddSPU(tilesortspu)
	for (name, value) in APP_OPTIONS:
		clientnode.Conf(name, value)

	# argument substitutions
	if PROGRAM != "":
		if i == 0 and ZEROTH_ARG != "":
			app_string = string.replace( PROGRAM, '%0', ZEROTH_ARG)
		else:
			app_string = string.replace( PROGRAM, '%0', '' )
		app_string = string.replace( app_string, '%I', str(i) )
		app_string = string.replace( app_string, '%N', str(NUM_APP_NODES) )
		clientnode.Conf( 'application', app_string )

		if AUTO_START_APPS:
			clientnode.AutoStart( ["/bin/sh", "-c",
					"LD_LIBRARY_PATH=%s %s/crappfaker" % (crlibdir, crbindir) ] )

	clientNodes.append(clientnode)



if REASSEMBLY:
	reassembleNode = CRNetworkNode(REASSEMBLE_HOST)
	reassembleSPU = SPU('render')
	reassembleNode.AddSPU(reassembleSPU)
	for (name, value) in REASSEMBLE_OPTIONS:
		reassembleSPU.Conf( name, value )
	if AUTO_START_SERVERS:
		reassembleNode.AutoStart( ["/usr/bin/ssh", REASSEMBLE_HOST,
								"/bin/sh -c 'DISPLAY=:0.0  CRMOTHERSHIP=%s  LD_LIBRARY_PATH=%s  crserver'" % (REASSEMBLE_HOST, crlibdir) ] )

# Loop over servers
for serverIndex in range(NUM_SERVERS):

	serverTiles = TILES[serverIndex]
	if len(serverTiles) == 0:
		continue

	# Create this server's readback/render SPU
	if REASSEMBLY:
		renderspu = SPU('readback')
	else:
		renderspu = SPU('render')
	for (name, value) in READBACK_OPTIONS:
		renderspu.Conf(name, value)

	# Create network node
	if serverIndex < len(SERVER_HOSTS):
		host = SERVER_HOSTS[serverIndex]
	else:
		host = SERVER_HOSTS[-1]  # use last server
	servernode = CRNetworkNode(host)

	# Add the tiles
	for tile in serverTiles:
		servernode.AddTile(tile[0], tile[1], tile[2], tile[3])

	# Add SPU to node, node to mothership
	servernode.AddSPU(renderspu)
	if REASSEMBLY:
		packspu = SPU('pack')
		servernode.AddSPU(packspu)
		packspu.AddServer( reassembleNode, protocol='tcpip' )

	for (name, value) in SERVER_OPTIONS:
		servernode.Conf(name, value)
	cr.AddNode(servernode)

	# connect app nodes to server
	for i in range(NUM_APP_NODES):
		tilesortSPUs[i].AddServer(servernode, protocol='tcpip', port=7001+serverIndex)

	# auto-start
	if AUTO_START_SERVERS:
		servernode.AutoStart( ["/usr/bin/ssh", host,
								"/bin/sh -c 'DISPLAY=:0.0  CRMOTHERSHIP=%s  LD_LIBRARY_PATH=%s  crserver'" % (localHostname, crlibdir) ] )


# Add nodes to mothership
for i in range(NUM_APP_NODES):
	cr.AddNode(clientNodes[i])
if REASSEMBLY:
	cr.AddNode(reassembleNode)

# Set mothership params
for (name, value) in MOTHERSHIP_OPTIONS:
	cr.Conf(name, value)

cr.Go()
vrcim-reassemble.conf (text/plain, 5.5 KB)
# Copyright (c) 2001, Stanford University
# All rights reserved
#
# See the file LICENSE.txt for information on redistributing this software.

# This is an example of tilesort-reassembly into an application window.
#
# The app node has a tilesort SPU that connect to two servers.
# Each server has two tiles (four total).
# A readback SPU runs on each server.
# The readback SPUs send two tiles each to the render SPU.
# The render SPU uses render_to_app_window to render into the original
# application window.  The render SPU window is never displayed.

# Brian Paul  16 July 2002


# WARNING! WARNING! WARNING! WARNING!
#
# If you enable both 'extract_alpha' and RENDER_BACK you'll probably crash
# your X server if using the NVIDIA 2960 drivers.  This is probably because
# the render SPU GLX context has different visual attributes (an alpha channel)
# that the original app window lacks.  This mismatch shouldn't cause a crash
# but it does.   (Brian - 20 August 2002)
#

import sys
sys.path.append( "../server" )
from mothership import *

if len(sys.argv) < 2:
		PROGRAM = "atlantis -s 100"
else:
		PROGRAM = sys.argv[1]

# Server(s) base hostname.  If your cluster has hosts named cr1, cr2, cr3,
# etc. you'd set ServerHost = 'cr'.  If you leave ServerHost as '' then
# all nodes will be on your local host.
ServerHost = 'slave'

cr = CR()
cr.MTU( 1024*1024 )  # may need larger value for big windows

TILE_COLS = 4  # don't change these unless you overhaul LayoutTiles()
TILE_ROWS = 4

MAX_TILE_WIDTH = 300
MAX_TILE_HEIGHT = 300

NUM_SERVERS = 4  # don't change these unless you overhaul LayoutTiles()

SLOP = 30  # window border

REASSEMBLE = 1   # use readback SPUs and downstream render SPU
RENDER_BACK = 1  # render back into app window
RESIZABLE = 1    # track client window size changes

AUTO_START_SERVERS = 1
AUTO_START_APPS = 1
REASSEMBLE_HOST = "vr-master"
SERVER_HOSTS = ['slave1', 'slave2', 'slave3', 'slave4']

# This is a callback which we register with spu.TileLayoutFunction()
def LayoutTiles(muralWidth, muralHeight):
	"""Return list of tuples of new tiles for the given mural size.
	Each tuple is of the form (serverIndex, x, y, width, height)."""

	if muralWidth > MAX_TILE_WIDTH * TILE_COLS:
			print "Warning: mural size is too wide!"
			muralWidth = MAX_TILE_WIDTH * TILE_COLS
	if muralHeight > MAX_TILE_HEIGHT * TILE_ROWS:
			print "Warning: mural size is too tall!"
			muralHeight = MAX_TILE_HEIGHT * TILE_ROWS

	# four tiles
	w = muralWidth / 2
	h = muralHeight / 2
	t0 = (0, 0, 0, w, h) # lower-left
	t1 = (1, w, 0, muralWidth - w, h) # lower-right
	t2 = (1, 0, h, w, muralHeight - h) # upper-left
	t3 = (0, w, h, muralWidth - w, muralHeight - h) # upper-right

	tiles = []
	tiles.append(t0)
	tiles.append(t1)
	tiles.append(t2)
	tiles.append(t3)
	return tiles


# The application node (tilesort SPU)
tilesortspu = SPU( 'tilesort' )
tilesortspu.TileLayoutFunction( LayoutTiles )
#tilesortspu.Conf('broadcast', '1')
tilesortspu.Conf('bucket_mode', 'Non-Uniform Grid')

client_node = CRApplicationNode( )
client_node.StartDir( crbindir )
client_node.SetApplication( PROGRAM )
client_node.AddSPU( tilesortspu )
client_node.Conf('track_window_size', RESIZABLE)

if AUTO_START_APPS:
	client_node.AutoStart( ["/bin/sh", "-c", "LD_LIBRARY_PATH=%s %s/crappfaker" % (crlibdir, crbindir) ] )

cr.AddNode( client_node )


# Final reassembly node (render SPU)
if REASSEMBLE:
	render_node = CRNetworkNode()
	render_node.Conf('shared_windows', 1)
	renderspu = SPU('render')
	renderspu.Conf( 'window_geometry',
		 [850, 0, TILE_COLS * MAX_TILE_WIDTH, TILE_ROWS * MAX_TILE_HEIGHT] )
	renderspu.Conf('render_to_app_window', RENDER_BACK)
	renderspu.Conf('resizable', RESIZABLE)
	render_node.Conf('only_swap_once', 1)
	render_node.AddSPU(renderspu)

	if AUTO_START_SERVERS:
		render_node.AutoStart( ["/usr/bin/ssh", REASSEMBLE_HOST, "/bin/sh -c 'DISPLAY=:0.0  CRMOTHERSHIP=%s  LD_LIBRARY_PATH=%s  crserver'" % (REASSEMBLE_HOST, crlibdir) ] )

	cr.AddNode( render_node )


# create server nodes
serverNodes = range(NUM_SERVERS)
for i in range(NUM_SERVERS):
	if ServerHost == '':
		serverNodes[i] = CRNetworkNode( )
	else:
		serverNodes[i] = CRNetworkNode( ServerHost + str(i + 1) )
	if REASSEMBLE:
		readbackspu = SPU( 'readback' )
		readbackspu.Conf( 'window_geometry',
						  [0, i * (MAX_TILE_HEIGHT + SLOP),
						  2 * MAX_TILE_WIDTH, MAX_TILE_HEIGHT] )
		readbackspu.Conf('extract_alpha', 0)
		readbackspu.Conf('extract_depth', 0)
		readbackspu.Conf('title', 'readback SPU %d' % i)
		serverNodes[i].AddSPU( readbackspu )

		packspu = SPU('pack')
		serverNodes[i].AddSPU(packspu)
		serverNodes[i].AutoStart( ["/usr/bin/ssh", SERVER_HOSTS[i], "/bin/sh -c 'DISPLAY=:0.0  CRMOTHERSHIP=%s  LD_LIBRARY_PATH=%s  crserver'" % (REASSEMBLE_HOST, crlibdir) ] )

		packspu.AddServer( render_node, protocol='tcpip' )
	else:
		renderspu = SPU( 'render' )
		renderspu.Conf( 'window_geometry',
						  [0, i * (MAX_TILE_HEIGHT + SLOP),
						  2 * MAX_TILE_WIDTH, MAX_TILE_HEIGHT] )
		serverNodes[i].AddSPU( renderspu )
	tilesortspu.AddServer( serverNodes[i], protocol='tcpip', port=7001 + i )
	serverNodes[i].Conf('optimize_bucket', '0')
	cr.AddNode( serverNodes[i] )



# setup tiling
for row in range(TILE_ROWS):
	for col in range(TILE_COLS):
		index = row * TILE_COLS + col
		srv = index % NUM_SERVERS
		node = serverNodes[srv]
		node.AddTile( col * MAX_TILE_WIDTH,
									(TILE_ROWS - row - 1) * MAX_TILE_HEIGHT,
									MAX_TILE_WIDTH, MAX_TILE_HEIGHT )


cr.Go()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.