Download Code on GPU (Intel Sandy Bridge)

My question is not about GPGPU. I understand GPGPU pretty well, and that's not what I'm looking for. Intel Sand Bridge is supposed to have some features that allow you to directly perform calculations on the GPU.

It's true?

The code I plan to write will be included in the inline assembly (in C). Are there assembly instructions that instead of executing on the CPU displace stuff on the GPU?

Some related documents:

PDF has a set of instructions.

+6
source share
2 answers

Answering your first question: No, it is not.

Let me quote from the resources you linked:

The graphics processing module is controlled by the processor through the direct IO interface with the display of the memory of the registers and indirectly through parsing commands that the CPU has placed in memory. (Chapter 2.2 of the SB GPU manual)

Thus, direct GPU code execution in the cpu context is not executed.

For your second question: "Pushing stuff to the GPU" is executed with the mov instruction. Target is a mem-mapped I / O register, the source of the material you want to write. You may need to insert some "sfence" or similar instructions to make sure that there is no reordering of weak memory.

+2
source

I do not believe that the set of instructions described in detail in the linked PDF file can be directly used from the "user space". This is what the GPU driver on your OS can * use to implement higher-level interfaces such as OpenGL and DirectX.

For what it's worth, the Sandy Bridge GPU is pretty weak. It does not support OpenCL **, which is the standard GPGPU library that is supported by ATI / nVidia. I would recommend you a program for this library (on hardware that supports it), since it is much more portable (and easy to use!) Than trying to program the interface you are looking for.


*: It is possible, although it is unlikely, that there is a different interface than the one described in this PDF document, which is used in Intel's closed source drivers.

**: Not the same as OpenGL, although it was developed by the same group.

+3
source

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


All Articles