How do I create a GLSL shader to work on Crossfire / SLI

If I write a visualizer with glsl, how can I guarantee that it will use more gpu? Out of the box, it only works on one thing, what steps / software design will allow a parallel pixel shader in parallel on multiple cards?

+4
source share
2 answers

From the comments in Jarrod, he says that the β€œproblem” you are working with is AFR mode (alternative frame rendering) and SFR mode (frame splitting), which is the problem of setting the driver mode.

In AFR mode, the driver sends each full frame to one GPU and sends alternative frames to another GPU. This is great for games and animations where you are most interested in maximizing frame rates and don't care about frame latency. Using a GPU in this way gives you pretty much 2x fps acceleration for SLI with little effort. But if you draw only one frame (as it seems, for example, from your comment), it will use only one GPU.

In SFR mode, the driver splits each frame and displays a portion of each frame on each GPU. The problem with this mode is that both GPUs must do all the settings for each frame, so you won’t get 2x acceleration. In fact, pretty much the only thing that will be accelerated is fragment shaders (since each GPU will execute half the fragments), so if only 50% of your (one GPU) rendering time is fragments, you will only get the best) 33% acceleration. You can get less, because the split can be unbalanced (therefore, one GPU ends with most fragments).

Because SFR is generally slower, AFR is the default. You can control AFR vs SFR using the control panel.

+3
source

Zero steps required in GLSL. The SLI / Crossfire driver takes care of dividing the workload into GPUs for you. The same goes for nVidia surround and AMD Eyefinity: as far as shaders are concerned, this is just a big rendering goal.

See these nVidia: SLI slides in OpenGL , especially the "Things Interfering with SLI" slides.

You want to make sure that your render cycle is set up correctly (i.e. SwapBuffers is invoked), and that you are at least twice buffered for SLI mode in AFR mode.

+3
source

Source: https://habr.com/ru/post/1442095/


All Articles