Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DirectX 11: simultaneous use of multiple adaptors

We need to drive 8 to 12 monitors from one pc, all rendering different views of a single 3d scenegraph, so have to use several graphics cards. We're currently running on dx9, so are looking to move to dx11 to hopefully make this easier.

Initial investigations seem to suggest that the obvious approach doesn't work - performance is lousy unless we drive each card from a separate process. Web searches are turning up nothing. Can anybody suggest the best way to go about utilising several cards simultaneously from a single process with dx11?

like image 693
Jason Williams Avatar asked May 16 '12 19:05

Jason Williams


1 Answers

I see that you've already come to a solution, but I thought it'd be good to throw in my own recent experiences for anyone else who comes onto this question...

Yes, you can drive any number of adapters and outputs from a single process. Here's some information that might be helpful:

In DXGI and DX11:

Each graphics card is an "Adapter". Each monitor is an "Output". See here for more information about enumerating through these.

Once you have pointers to the adapters that you want to use, create a device (ID3D11Device) using D3D11CreateDevice for each of the adapters. Maybe you want a different thread for interacting with each of your devices. This thread may have a specific processor affinity if that helps speed things up for you.

Once each adapter has its own device, create a swap chain and render target for each output. You can also create your depth stencil view for each output as well while you're at it.

The process of creating a swap chain will require your windows to be set up: one window per output. I don't think there is much benefit in driving your rendering from the window that contains the swap chain. You can just create the windows as hosts for your swap chain and then forget about them entirely afterwards.

For rendering, you will need to iterate through each Output of each Device. For each output change the render target of the device to the render target that you created for the current output using OMSetRenderTargets. Again, you can be running each device on a different thread if you'd like, so each thread/device pair will have its own iteration through outputs for rendering.

Here are a bunch of links that might be of help when going through this process:

Display Different images per monitor directX 10

DXGI and 2+ full screen displays on Windows 7

http://msdn.microsoft.com/en-us/library/windows/desktop/ee417025%28v=vs.85%29.aspx#multiple_monitors

Good luck!

like image 172
Allen Pestaluky Avatar answered Oct 12 '22 08:10

Allen Pestaluky