GL over remote X ;was Re: [lug] good assert library
Chan Kar Heng
karheng at softhome.net
Sun Oct 6 16:12:42 MDT 2002
greetings.
just posting a very brief and _surface_ follow up on a recent thread
regarding GL under X.
i was only interested to know what gets sent across through the
X protocol... so here are some _surface info_...
from what i gather, pixmaps (bitmaps and the likes) get set across
as is. (this i got to know about while reading gtk programming tutorials
few years back).
otherwise, window frames, buttons, labels, and basic graphical
elements are sent as commands (not as bitmaps/pixmaps).
it gets sent across as something like DrawRectangle(x1,y1,x2,y2)
and so forth.. something like vector graphics...
(this is based on what i see from the names of some Xlib api
functions; it would be unlikely that these commands are
rasterized before being sent).
i took a glance at the functions here:
http://www.rahul.net/kenton/xproto/xlib2xproto.html
http://www.rahul.net/kenton/xproto/xproto2xlib.html
i'm not too sure how text is sent... didn't find out on that... sending
the text isn't the issue... how the text font is rendered on a remote
machine would be the issue...
as for GL... there's an X extension for it.. called GLX. (been catching
glimpses of this around places for quite a while, but only bothered
to read and know it recently.. sigh).
apparently, GLX somehow "marshals" GL commands.
that means, GL commands get packaged and sent to the context
in the X server before they are rasterized.
there's some mention of it here... though not direct, specific or lengthy.
http://www.plunk.org/opengl/gdc2000_whitepaper.pdf
there's also an unofficial GL stream codec api too...
http://www.opengl.org/developers/documentation/Specs/glsspec.txt
came up with these through a simple research during some spare time.
some of these info might be deduced assumptions...
hope i've not posted any misleading info so far... if so, please
correct me...
thanks
rgds,
kh
>>>anyway, would you know what gets sent across network in
>>>the case where machine A runs an X opengl program that
>>>resides on machine B? (remote X)...
>>
>>I believe there is an OpenGL intercept/proxy library that can be used to catch OpenGL calls and log them, sort of like ltrace or strace for normal library or system calls. What I don't know is if any of these are available under Linux, I know there are several under Win32. Some names for Win32 side, which might or might not have a Linux version:
>> Chromium, glTrace, HijackGL, GPT, ZapDB
>>
>>(and even if they do have Linux versions, they might not be what you want, and they might fail under remote X11)
>>
>>You might be more interested in using a network sniffing tool on the X11 port. There is a possibility that if compression is being used over the network, you could find the right arguments to make X11 *not* compress, to aid debugging.
>
>didn't know there were existing GL interceptors/proxy libraries around..
>thanks for the info! :)
>but i suspected there'd be some kind of this library within the GL implementation
>for X too.. hmm..
>
>btw, i'd probably have to use telnet instead of ssh for the X connection
>to use a net sniff tool.. :)
>
>perhaps i'd just see if i could check it out from the X mailing list or Mesa
>mailing list or from parts of the X or Mesa sources... hmm.
>
>
>>>either arguments of opengl function calls get sent or the
>>>rendered images on the window get compressed and sent.
>>>i'm wondering which... or maybe it works another way?
>>
>>I couldn't answer that, you are at the driver level there, for both OpenGL and X11. X11 tends to have a surrogate copy of state on both machines, and what it actually sends depends on what calls are made; some information seeking requests will cause flushing of buffers and lower performance, whereas otherwise it can be allowed to throw out some values from unused events, if a series of events do not require the intermediate events. I doubt it matters that OpenGL is involved, except that there might be an X extension involved. Mostly I would say it is up to X protocols.
>
>gee... copies of state on both machines??
>hmm!
>anyway, somehow i've got a feeling that there's a specific version
>for X... will check it out... and if i find out, i'll post some info here on
>the list.. :)
>
>
>
>>Knowing more about what you want to accomplish could help. The most common failure I've seen from just playing with it is that sometimes people try to use the X Shared Memory mechanism, and do not offer a way to turn it off...there is an underlying assumption in such code that the app is always running and displaying on the same machine (not a bad assumption if it is Win32 or Mac code that got ported to Linux/X11).
>
>well, actually was toying with the idea of a client server s/w that
>renders across network... havn't really thought of the specific area
>of application yet..
>
>heavy implementation on server side, thin implementation on client
>side...
>the server would probably need several contexts for each client
>connection or group session...
>
>anyway, i played around with GL remote X to test out feasibility...
>i still get fairly good speed at 19.2Kbps with a ssh remote X connection.
>so i was just wondering how it was done.. :)
More information about the LUG
mailing list