What is VirtualGL?
(由于后面可能做Windows 3D redirection, 细看,译之。不少地方译得还有问题,Anyway! 先贴上来,再慢慢改吧!要不然可能永远不会再修饰了!)
VirtualGL is an open source package that gives any Unix or Linux remote display software the ability to run OpenGL applications with full 3D hardware acceleration. Some remote display software lacks the ability to run OpenGL applications at all. Other remote display software forces OpenGL applications to use a slow software-only OpenGL renderer, to the detriment of performance as well as compatibility. The traditional method of displaying OpenGL applications to a remote X server (indirect rendering) supports 3D hardware acceleration, but this approach causes all of the OpenGL commands and 3D data to be sent over the network to be rendered on the client machine. This is not a tenable proposition unless the data is relatively small and static, unless the network is very fast, and unless the OpenGL application is specifically tuned for a remote X-Windows environment.
VirtualGL是一个开源程序包,它使得Unix和Linux远程显示软件在运行OpenGL应用程序时具有完全的3D加速。一些远程显示软件根本运行不了OpenGL应用程序,另外一些远程软件强制OpenGL应用程序运行在速度较慢的、基于软件的OpenGL渲染器上,损害了性能的同时也损害了兼容性。传统方法将OpenGL应用程序重定向到远程X server 来支持3D硬件加速,然而,这个方法需要将OpenGL 命令和3D数据通过网络传输到客户端。这个方案难以接受,除非数据相对较小且为静态的,网络非常快,OpenGL应用程序为远程 X-Windows环境进行了定制。
With VirtualGL, the OpenGL commands and 3D data are instead redirected to a 3D graphics accelerator on the application server, and only the rendered 3D images are sent to the client machine. VirtualGL thus "virtualizes" 3D graphics hardware, allowing it to be co-located in the "cold room" with compute and storage resources. VirtualGL also allows 3D graphics hardware to be shared among multiple users, and it provides "workstation-like" levels of performance on even the most modest of networks. This makes it possible for large, noisy, hot 3D workstations to be replaced with laptops or even thinner clients. More importantly, however, VirtualGL eliminates the workstation and the network as barriers to data size. Users can now visualize huge amounts of data in real time without needing to copy any of the data over the network or sit in front of the machine that is rendering the data.
在OpenGL的框架下,OpenGL 命令和3D数据都重定向到一个应用程序所在的服务端的3D显卡加速器,只有渲染好的图像才最终发到客户端。VirtualGL因而虚拟化了3D显卡硬件,允许它们和计算资源、存储资源一样位于"cold room" (数据中心?)。VirtualGL允许多个用户共享一个显卡硬件,即使在现代网络中,也能提供了和workstation(工作站)类似的性能(it provides "workstation-like" levels of performance on even the most modest of networks)。这样,巨大的、吵闹的、热的工作站就可以用笔记本甚至瘦终端替换。更重要的是,VirtualGL消除了工作站和网络间的数据大小的障碍。用户能够实时可视化大量的数据,而不需要通过网络复制任何数据或者坐在渲染数据在机器旁。
Normally, a Unix OpenGL application would send all of its drawing commands and data, both 2D and 3D, to an X-Windows server, which may be located across the network from the application server. VirtualGL, however, employs a technique called "split rendering" to force the 3D commands from the application to go to a 3D graphics card in the application server. VGL accomplishes this by pre-loading a dynamic shared object (DSO) into the OpenGL application at run time. This DSO intercepts a handful of GLX, OpenGL, and X11 commands necessary to perform split rendering. Whenever a window is created by the application, VirtualGL creates a corresponding 3D pixel buffer ("Pbuffer") on a 3D graphics card in the application server. Whenever the application requests that an OpenGL rendering context be created for the window, VirtualGL intercepts the request and creates the context on the corresponding Pbuffer instead. Whenever the application swaps or flushes the drawing buffer to indicate that it has finished rendering a frame, VirtualGL reads back the Pbuffer and sends the rendered 3D image to the client.
通常情况下,一个Unix OpenGL应用程序会将所有2D和3D的绘制指令和数据发到一个X-Windows server,X-Windows server可能位于服务端所能达到的网络上。然而,VirtualGL用了一种split rendering的技术强制3D指令走向服务端的显卡。VGL通过在应用程序运行时,预加载一个dynamic shared object (DSO) 来做到。这个DSO拦截了大量split rendering所需要的GLX, OpenGL, and X11 指令。当应用程序的窗口被创建时,VGL在服务端的显示上创建一个对应的3D像素缓存(Pbuffer )。当应用程序要求创建OpenGL上下文时,VGL拦截这个要求,并创建对应的Pbuffer。当应用程序通过交换或者刷新绘制缓存来暗示它已经完成一帧的渲染时,VGL读取Pbuffer ,并将它发送到客户端。
The beauty of this approach is its non-intrusiveness. VirtualGL monitors a few X11 commands and events to determine when windows have been resized, etc., but it does not interfere in any way with the delivery of 2D X11 commands to the X server. For the most part, VGL does not interfere with the delivery of OpenGL commands to the graphics card, either (there are some exceptions, such as its handling of color index rendering.) VGL merely forces the OpenGL commands to be delivered to a server-side graphics card rather than a client-side graphics card. Once the OpenGL rendering context has been established in a server-side Pbuffer, everything (including esoteric OpenGL extensions, fragment/vertex programs, etc.) should "just work." If an application runs locally on a 3D server/workstation, then that same application should run remotely from that same machine using VirtualGL.
该方法的美妙之处在于它是非侵入式的。VGL监视了少量的X11指令和事件来决定窗口什么时候调整了大小等别的事件,但它并没有干涉2D X11指令到X server的任何过程。对于大多数的情况,VGL并不干涉OpenGL指令到显示的传送过程(有一些例外,如处理颜色索引渲染)。VGL仅强制OpenGL指令传送到服务端显卡而不是客户端显卡。一旦OpenGL 渲染上下文建立好了,别的方面都会everything (including esoteric OpenGL extensions, fragment/vertex programs, etc.)自然而然地工作。如果一个应用程序能够在3Dserver/workstation运行,在VGL的帮助下,它也能远程运行于同一机器。