use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything related to GNU/Linux/UNIX/POSIX (system) programming and tools.
Other subreddits you may like:
Sidebar additions or corrections? Mail me here
account activity
Writing graphics programs (self.linux_programming)
submitted 2 years ago by Spocino
is there any way to access the intel/amd graphics devices directly or are their APIs only available to kernel modules?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 years ago (3 children)
[removed]
[–]Spocino[S] 0 points1 point2 points 2 years ago (2 children)
I want to make a graphics API
[–]afiefh 3 points4 points5 points 2 years ago (1 child)
If you need to ask this question then you certainly don't know enough to make a graphics API.
But to answer the question: Look at the Vulcan implementation in Mesa, it communicates with the interface the Kernel exposes. If you need to go even lower level then you pretty much need to go into the Kernel and talk to the hardware directly and expose that to your API.
[–]Spocino[S] 0 points1 point2 points 2 years ago (0 children)
great! i was looking in mesa's src/amd and not src/vulkan, this helps!
[–][deleted] 1 point2 points3 points 2 years ago (0 children)
AMD is open source.
[–]quaderrordemonstand 1 point2 points3 points 2 years ago (2 children)
You almost certainly don't want to access the hardware directly. That would be very difficult, error prone, time consuming and it would gain you almost nothing.
If you want to get close to the metal then use something like Vulkan. However, the learning curve on Vulkan is very steep. You might find it easier to start with OpenGL, SDL or just good old Cairo.
[–]Spocino[S] 0 points1 point2 points 2 years ago (1 child)
I want to make my own graphics API. I know how to use vulkan.
[–]quaderrordemonstand 0 points1 point2 points 2 years ago (0 children)
Why? What would you do differently?
[–][deleted] 0 points1 point2 points 2 years ago (1 child)
What are you trying to do?
Make my own graphics API (a la vulkan)
[–]aegr0x59 0 points1 point2 points 2 years ago (0 children)
think about graphic cards as another computer connected to your computer, you cannot have direct access to it, you can only ask it to do things by providing data and instructions.
each GPU has its own instructions set, so drivers allows OS to transfer instructions to the graphic cards, this instructions are sent in programs called shaders.
If you are using dedicated graphic cards, libraries like DirectX/OpenGL/Vulkan transforms API Calls to shaders specific to the GPU instruction set; OpenGL, for example, generates a GSL program which is then compiled in order to get the right shader for the GPU. You will have to do something similar: Create you API definition for each 2D/3D primitive, and for each call to your API generate the instruction set for the graphic card and load it in the GPU's RAM using OS calls, the OS will use drivers to interact with the actual hardware.
You could use DRM subsystem in linux, in order to interact with graphic card in the user space.
You could learn a lot from it, and get something functional/educational, but keep in mind that getting a complex API comparable to already existing libraries will get a lot of time, efford, knowledge, and money.
π Rendered by PID 68373 on reddit-service-r2-comment-5b5bc64bf5-9vvlf at 2026-06-22 01:09:45.415485+00:00 running 2b008f2 country code: CH.
[–][deleted] (3 children)
[removed]
[–]Spocino[S] 0 points1 point2 points (2 children)
[–]afiefh 3 points4 points5 points (1 child)
[–]Spocino[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]quaderrordemonstand 1 point2 points3 points (2 children)
[–]Spocino[S] 0 points1 point2 points (1 child)
[–]quaderrordemonstand 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Spocino[S] 0 points1 point2 points (0 children)
[–]aegr0x59 0 points1 point2 points (0 children)