[SlimDx]: 64 bit and Multiple GPU access

Started by
9 comments, last by Codeka 14 years, 8 months ago
I have a couple of questions to this framework: 1) Will this framework run on a 64bit OS as a 64bit application? (I need it to access more than 4GB of RAM) 2) Will this framework allow me to chose what GPU that I work with, so that I can load different textures in each GPU? 3) Will this framework allow me to load textures from disk into RAM and then later move it from RAM into VRAM (Video RAM) of any given GPU? 4) Will this framework allow me to read the level of free VRAM in each GPU for textures? 5) Will this framework allow me to dispose textures in a given GPU that I no longer need?
Advertisement
1) Yes, see documentation.
2) We expose native D3D verbatim, and it would be done the same way.
3) Same as (2).
4) Same as (2), however the numbers reported vary from inaccurate (WinXP) to completely wrong (Vista+). I recommend you do not do this at any point; however WMI should be able to report the correct number.
5) Same as (2).
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
This is GREAT news. Thank you!!

When playing with the example code and reading the documentation, I failed to figure out how to get the number of graphics devices (GPU) on the computer. And also I was unable to select which one to use.

If I read the docs on GetAdapterCount and GetAdapter correctly, this should work:

int MyAdapterCount = SlimDX.DXGI.Factory.GetAdapterCount();
SlimDX.DXGI.Adapter MyAdapter = SlimDX.DXGI.Factory.GetAdapter(MyAdapterCount-1);

However, the Visual Studio code complete engine does not recognize the methods GetAdapterCount and GetAdapter.

Links to docs are below:

http://slimdx.mdxinfo.com/latestdocs/Default.aspx?helpfile=Help/Html/M_SlimDX_DXGI_Factory_GetAdapter_1_cd2d7ec9.htm

http://slimdx.mdxinfo.com/latestdocs/Default.aspx?helpfile=Help/Html/M_SlimDX_DXGI_Factory_GetAdapterCount.htm
Those aren't static methods; you need to actually create an instance of a DXGI factory first.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Thanks! This worked perfectly!! To help others, here is what I did:

SlimDX.DXGI.Factory myFactory = new SlimDX.DXGI.Factory();
int MyAdapterCount = myFactory.GetAdapterCount();
SlimDX.DXGI.Adapter MyAdapter = myFactory.GetAdapter(MyAdapterCount-1);

Next question: I seem to recall, that I could read how much of the texture memory is free, so that I know if there is room for more textures or if I shall dispose some of the existing ones first. Strangely enough I can't find that anymore... You mentioned in your first post, that this number was not accurate - is that valid for Windows 7 too? You also suggest using WMI. I'm afraid I do not know what WMI means and how I would use that to get the memory status.
The 9 device at least offers a function to get available texture memory; it's just that the number tends to be a lie.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
What does "9 device" mean? Even if the number turns out to be bogus, when you try to load a texture, I would assume that you could capture some kind of exception, and then use that to learn that you have filled the memory, and in that case dispose some older elements and add the one again? Could that work?
9 as in D3D 9. Yes, catching the exception (which would have a code of ResultCode.OutOfMemory I guess) would work, I imagine. I dunno that it's the best way to handle it.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
For reference: This is documented here:
http://slimdx.mdxinfo.com/latestdocs/Default.aspx?helpfile=Help/Html/P_SlimDX_Direct3D9_Device_AvailableTextureMemory.htm

Yes, the number is very likely bogus. My little laptop with Nvidia FX-570M reports "1592786944" as free texture memory.

Thanks for your help. I'll keep diving and learning the framework. Very exciting and promising I must say.
My experience with DirectX is limited to what I got from working with XNA. They provided good examples on how to load an XNB file into a texture, then draw that texture in a sprite batch.

Would you know where to find a similar simple example? The examples I found with the XNA framework seemed to focus on vertex and not sprites... Also I am not sure what format SlimDx will want textures in. I am sure it is not XNB, but I would not expect it to be JPG either. As you can see this question is based on my exposure to XNA and not C++ direct X programming.

This topic is closed to new replies.

Advertisement