William Davis - Summer '08 REU in Mathematics


Student Head of the Celestial Mechanics Group
Last edited by: William Davis - July 9, 2008 - wldavis2@illinois.edu

CUDA in the Virtual Environments


CUDA displays the power of using GPUs as processors (which is mostly a good idea, sometimes not though). Our goal was to be able to use this processing power for particle systems in the virtual environments. Our "experimental program" was the FluidsGL particle example included as an example with CUDA.


We were able to extract and separate the CUDA computations from the OpenGL viewer using what has become known as the "Schaber Method". There are two types of viewers: the static viewer and the dynamic viewer. The static viewer takes as input on the command line a data file that has previously been output by the Fluids CUDA computational server. This requires no knowledge of sockets and no communication over the network, but it is not interactive (all of "interactivity" must be part of the data file). The dynamic viewer, on the other hand, connects to the CUDA computational server using BSD standard sockets, where any user input is sent to the computational server, which applies the appropriate changes, and sends the client viewer program an updated scene.


Unfortunately, this is not enough to use the CUDA computational server in sync with the virtual environments, as the virtual environments are run on Windows machines and therefore are not socket compatible with BSD standard sockets. Furthermore, Syzygy uses its own socket standard that, as far as we can tell, abstracts away the differences between BSD and Windows sockets. Normally, one would just convert the socket access calls in both the server and the client to reference the Syzygy libraries instead - but as it may be difficult to compile both CUDA and Syzygy in the same program, we have attempted to steer clear of this and instead have set up a "relay" program that forwards data received on Syzygy sockets to the BSD sockets, and vice versa.


There will be a more detailed explanation of the Shaber Method and the subsequent process of enabling a CUDA application to be put into the virtual environments later, which will be linked on this page. As of July 7, 2008, this method is known to work with the virtual environments at the Beckman Institute of Research, which runs on Windows machines, albeit slowly (the network transfer is the greatest hinderance here).


Update July 9, 2008: Chase Boren has written up an extensive walkthrough on how to convert CUDA applications to Syzygy applications using the method described above.