I’d like to know the relation between the hardware used by GPGPU and the hardware used by Directx/OpenGL applications.
I mean, they are just different languages/concepts for the same hardware or each one has their own area on the graphics card (perhaps with a intersection)?
This is a common question when I’m explaining to someone about CUDA technology and I couldn’t find the answer in the internet.
The line is blurry between hardware that supports GPGPU and hardware that supports OpenGL/DirectX. In most cases it is possible to emulate features from one on the other. For example, CUDA provides an abstraction of a flat global address space that is byte addressable where OpenGL works with buffers that have restrictions on pointer operations and are accessed with different alignment restrictions depending on the type of buffer. It is possible to emulate CUDA on hardware that does not have support for loads to arbitrary pointers using pointer analysis to determine which buffer a pointer is likely to point to and loading from it by name and offset. There are many examples like this.
They usually have the same area on the card. However, if some of the GPU hardware is designed with GPGPU in mind, it may have a performance advantage when executing GPGPU workloads and be more straightforward to write a compiler for.
I wouldn’t say the line is blurry - a lot of the hardware is shared. Vertex, geometry and pixel shaders are all executed using the same SMs that run CUDA programs. There is a small amount of hardware (interpolation, rasterization, raster ops) that is not used by CUDA.
probably not (although I don’t have knowledge of Microsoft internals).
At a high level, you can inspect what DirectX and OpenGL APIs do and what they abstract. The commands are like “render this pattern (e.g. texture) onto this shape”
Microsoft DirectX will take some form of that command and pass it off to the GPU DirectX driver (the portion written by NVIDIA). And while again I don’t know exactly what NVIDIA does, you can be sure that they write something like CUDA code, for some primitives, to achieve the desired command/effect. It’s probably not CUDA per se, but it does in some cases do arithmetic operations via the same underlying hardware that CUDA uses.
To get an idea of this, you can study shader languages such as GLSL, to see how they work. Those languages take advantage (in some cases) of the same underlying hardware that CUDA uses - SMs, caches, etc.
The NVIDIA GPU driver probably also manipulates other things that are not exposed in CUDA, like RTX cores, ROP engines, etc.
You can probably gain more insight by learning to use a tool like nsight graphics.