How to get direct access to the GPU?

Since most of you know that processors are not well designed for floating point calculations, unlike GPUs. I am wondering how to use GPU power without an abstraction layer or driver. Can I program for the GPU using the assembly language, C, C ++ (I mean, how?). Although the assembly seems to help me access gpu directly, C / C ++ most likely requires a library environment (such as OpenCL) to access the GPU.

Let me ask you another question: which of the modern features of the GPU will be available to the programmer without any third-party drivers?

+4
source share
3 answers

The interfaces are not documented, so something like OpenCL is the only practical way to directly program the GPU. Without a driver, you are stuck trying to completely redesign the full functioning of the GPU.

+5
source

Well, essentially, you have to write a driver on Windows or Linux. And the interfaces can be documented depending on which chipset you are trying to use. Intel has plenty of PDF documentation on its website. However, this is not a trivial exercise at best, and your code can only use this set of hardware. It is unlikely that in most cases reading and understanding the documentation will require a lot, because "OOP, which is not how it really works," and how to do this or that, only hardware and registers are not documented. However, if REALLY want to do this, it is best to start with Linux open source drivers for a specific chipset and twist it to the SICK TWISTED target. In general, with the exception of the learning aspect, this awakens the idea of ​​BAD.

0
source

A GPU maker such as NVDIA and ATI are closed source companies that choose not to disclose the GPU architecture and work with them for the general public. This is why we cannot directly program the GPU as we can with most processors. The only way we can use the power of the GPU to calculate is to use a provided library such as CUDA in the case of NVDIA. But there is a possible way by which you can directly program the GPU for calculations, but for this you need to redesign and document all the GPUs and their registers and SYSTEMCALLS, and you know that this is impossible with our access to limited resources and limited time.

PS: The only other way is to log in as the main developer for the GPU and sign the NDA (non-disclosure agreement) with suppliers that are most likely not to happen to starters and people like us.

0
source

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


All Articles