Universe Sandbox

Universe Sandbox

Mallikeet Jan 27, 2015 @ 2:13am
Will it use OpenCL?
Basically that. I'm hoping to see OpenCL used, since it seems like it'd be fun to play around with multi GPU acceleration for this game.
< >
Showing 1-1 of 1 comments
Addie Jan 27, 2015 @ 5:21am 
We do use OpenCL for acceleration, and we're able to utilize both CPUs and GPUs.

We test them both to determine which peforms better with double precision math. Some Graphics cards actually have really bad double precision performance 1 / 32 of the floating point performance in some cases. In those cases, a powerful CPU is actually much faster, as they tend to handle doubles with no issue.

Although, we can't currently do Multi-GPU acceleration at this time. This is partially due to driver constraints and how multi-gpu / sli / crossfire setups are supported when executing OpenCL kernels as well as some subtle technical issues.

Hopefully we'll be able to have Multi-GPU support in the future, but at this time it's not looking too practical.

Technical Reasons: When running N-body gravity you have to test against all other bodies in the simulation. So we have to upload to GPU memory all the data we plan to work on, such as the positions, velocity and mass of all objects in the simulation. This is actually a pretty costly operation in milliseconds, and we need to keep it under 16ms to maintain 60fps. Since we need to test each body against each other, it works well to distribute this across processing cores in a cpu or gpu. As that work is easily distributed. However when you add another GPU you don't get double performance as you would think. There's no way to meaningfully share information across the cards and break up the work between them. So you end up needing to send the dataset to both cards, and the extra time for cleanup and copying buffers back and forth pretty well negates the benefits gained. Long story short, all processors need access to the same dataset and you don't have that in a setup with two discrete gpus.


Last edited by Addie; Jan 27, 2015 @ 5:31am
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: Jan 27, 2015 @ 2:13am
Posts: 1