Hi Mojo people,
How likely is Mojo to create a (low level?) graphics library for Nvidia/AMD/Intel/etc graphics cards? Is this not an opportunity to obviate the need for OpenGl/Vulcan/Shader/DirectX/ etc software stack?
Even though graphics is orthogonal to the main aim of the Mojo language, it just seems like an significant opportunity for the language since it is already at the low level abstraction for these devices, why not just add a common graphics library into the standard library for graphics cards?
Thank you
1 Like
Modular has experience in AI development and all the AI development problems that go along with it. The Khronos Group and Microsoft have decades of experience in graphics. That doesn’t preclude Modular from getting into graphics or even Khronos Group/Microsoft using Modular to create yet another graphics solution. Maybe there is a problem that needs solving, I just do not know of it. When one “commits” code to a standard library, there’s a commitment to maintain that code because others will rely on it.
Previously, some have used sdl2 bindings for graphics display. What kind of gaps do you see a Mojo/Modular solution could fill that OpenGL/Vulkan/DirectX/sdl2 don’t already?
1 Like
Stepping even farther back, there’s a wonderful series authored by Chris Lattner about Modular’s existence, focus, and vision in
Part 5 talks about OpenCL.
Rather than there being “gaps” per se, there is a lot of heterogeneity in graphics programming. From primitives to shaders in multiple implementations on various operating systems, multiple standards through software stacks that need to be maintained by graphics hardware manufacturers. Mojo is in the position where it has access to low level instructions for these various graphics devices. Its just that these instructions are geared towards computation rather than graphical rendering. If Mojo is able to access these graphical primitives, that would remove the need for shader languages and other graphical instruction implementations. So in one language you could do SIMD, when you need to, GPU accelarated computations, as well as shader rendering. I think this would be very useful for people creating all sorts of graphical programs.
As I said, I acknowledge that the graphical play is orthogonal to what Mojo’s main focus is. I also acknowledge that there are a myriad of other considerations in this suggestion, its not like saying to someone “while you’re down there flip on a switch” or something, “its more like while you’re down there is it possible to do this whole other thing?” OpenCl is for compute than graphics rendering (like OpenGl) and yes firmly belongs within Mojo’s remit.
So yes, the first obvious way forward is FFI to current graphics stacks, but I think there is mileage for native graphics rendering play for Mojo, though I definitely appreciate that the bandwidth may not exist, and certainly consultation with the graphics hardware manufacturers and other stakeholders will be an important determining factor.
1 Like
You have to understand that OpenGL and Vulkan are not just software at this point.
The consumer GPUs are architected with those graphics back ends in mind.
Given our rather recent adoption of Vulkan, which long had stable C++ bindings, the Industry is not quite ready.
1 Like