If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
![]() |
|
|
#1 |
|
Junior Member
Join Date: Nov 2006
Posts: 27
|
I'm trying to understand how incorporate GPGPU functionality into my regular Direct3D programs. Right now all my main computational tasks are implemented as background threads in C++. I'd like to move some of those background computational tasks to the GPU for speed. I don't fully understand how to partition the D3D stuff:
1) Should I create a second Direct3D device for the GPGPU thread? Since the main D3D device is used extensively for rendering in Windows, I don't believe I can use it simultaneously in the background without complicating the rendering code tremendously and/or causing stuttering in the UI. 2) What's the easiest way to a create a "windowless" D3D device? The GPGPU thread will be used exclusively for computation and will not display anything. 3) Will creating a second device cause stuttering in my main UI when the GPGPU thread is busy crunching numbers? I guess I'm wondering how well D3D handles thread switching in a multithreaded program. I'd appreciate hearing anyone's thoughts and experience doing such a thing. Thanks |
|
|
|
|
|
#2 |
|
Registered
Join Date: Nov 2008
Posts: 6
|
I can help with #2:
Code:
ID3D10Device *g_pd3dDevice = NULL; D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &g_pd3dDevice); |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Nov 2006
Posts: 27
|
Quote:
Edit: wanted to add that my programs are scientific applications, not games. |
|
|
|
|
|
|
#4 |
|
chaos dunk
Join Date: May 2003
Location: Mountain View, CA
Posts: 3,274
|
Why are you using D3D for scientific computing instead of CUDA/Stream/waiting for OCL? CUDA has D3D interop, I don't know if Stream does, and OCL certainly has robust OGL interop.
|
|
|
|
|
|
#5 | |
|
Junior Member
Join Date: Nov 2006
Posts: 27
|
Quote:
All I was interested in was whether anyone here had used D3D for GPGPU computing as part of an app that already uses D3D extensively for rendering. Basically, what are the gotchas to look out for, etc. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|