Is it possible to "hijack" the graphics processor for computing use?

sleepydj

Member
Oct 16, 2003
25
0
0
hello,

I'm Jimmy and I'm new to this forum but a regular reader of Anandtech.com. I am an undergrad student and am working on a project. This project requires the use of image processing and also sound processing. The project also requires the use of multiple motors too.

We were planning on using a single board computer and I was wondering if i could just throw in a full motherboard along with the processor and RAM etc. I was thinking along the lines of an nforce1 or 2. We're planning to use Linux. From initial ideas of how things are going to work, i guess we'll need one processing thread for each 'device'. What worries me is the fact that image processing thread in conjunction with the audio processing thread would present a large task for the processor. And if one of these were to crash, then it would bring the whole system down and well, i needn't say more. Now, what interests me is the possibilty to use the graphics chip as a powerful co-processor, esp for the image processing component of the project. How difficult is it? What would I need? Are compilers available for say C/C++ which can compile the code for a Geforce 2/4 instruction set(depending on nforce 1 or2)? Where can I get more information regarding the architecture and instruction sets of the nVidia's graphics processors, esp the once on the nForce.

Apart from that, I want to hear what you guys have to say about this idea. If possible could you please post links which would have more information on this particular topic? Also, continuing in this direction, would it also be possible to similarly use the audio processing unit for general computing?

Thanks for your help.

Cheers,
Jimmy Desai
 

InlineFive

Diamond Member
Sep 20, 2003
9,599
2
0
If you could do this with a DX 8.1 or higher GPU the Distributed Computer folks would go wild because of the raw x87 power of GPUs. Now it would be basically who's CPU could feed information to their GPU the fastest. :)

We need to get a team of highly skilled computer programmers from the forums to work on this as it would be really cool. Maybe eventually they could make a program that would allow Windows to see a GPU as a second processor.

-Por
 

lifeguard1999

Platinum Member
Jul 3, 2000
2,323
1
0
Yes it is. I am at IEEE Visualization 2003 right now, and there are several papers and tutorials on the topic. One group has written a front end compiler to the C compiler do this. They use a C like language they wrote called Brook. Unfortunately, it will not be released until 15 Dec on sourceforge.

We actually had a heated discussion on ~why~ you would want to do computing on a GPU. After all, in one years time, GPUs will have changed so much that what you can do now, will not be useful anymore. :)
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
I think someone mentioned it, but you can do all sorts of calculations on the GPU if you use an API like DX or OpenGL. The only problem is, that you are really gonna have to mess around with the vertex buffers and such to make sure all the data is staying on the card and not being tossed back and forth between the CPU and the GPU.

If I were doing it, I'd make a wrapper class to abstract the nitty gritty stuff and make some nice general methods to do the sorts of calculations you're looking to do.

Once again, the really big issue is making sure you're not tossing data back and forth too often.

As far as the audio processor goes, as far as i know they arn't to flexible for doing general computing sorts of tasks.
 

kpb

Senior member
Oct 18, 2001
252
0
0
With the right kinda of problem and the right video card you definitely could do it. I don't think your going to have too much success with a nforce 1/2 tho. The intigrated video on those is at best a geforce 4mx which means it's just dx 7 and has very limited programability. To really get to the point of being able to impliment something meaningful your probably gonna want a dx 9 card which right now means a 150$+ add on card. You can probably manage some things on a dx8 card but even thats going to be limited.

If my memory serves correctly the dx's break down like the following.
dx 7 - fixed function hardware support for t&l and geometry
dx 8 - programable support in that you can control paramiters on standardized functions
dx 9 - fairly programably and can actually support custom shader code.
 

Shalmanese

Platinum Member
Sep 29, 2000
2,157
0
0
I also remember there being some limitation with bandwidth FROM the card to main memory. Cards were designed so that they could pull data very fast but not to store it back again. IIRC, the maximum bandwidth achieved was something like 12MB/min which is no good if your using it to render stuff with.I dont know if this is driver related or hardware related though.