Skip to content

What is Gallium, and why is it the reason Zinc cannot work with any Vulkan implementation?

Hi there,

I wanted to know why Mesa's Zinc can not work on Nvidia proprietary drivers for a while now. From what I know, Zinc is simply and OpenGL implementation that uses vulkan as a backend, same concept as DXVK.

Some people told me Zinc was actually a Gallium OpenGl implementation, which by name does not make sense to me.

I found this post that did clarify quite a lot, but it did not answer what the heck Gallium is. Searching it on Google only confused me even further, and it doesnt help that information on it is quite scarce

So what is Gallium exactly? How does it relate to Gallium nine and Zinc, and OpenGl for that matter?

Big thanks for any further info, that would really help me

4 points21 comments
Open on Reddit
About this post
Posted
Archived
Score
4 · 100% up
Kind
Text
ID
igfmb8

Author

59
posts
308
comments
8
media
View profile

21 comments

Gallium is kind of a toolkit for building drivers that Mesa uses internally. Zink isn't actually a full OpenGL implementation, it's a "driver" built using Gallium inside of Mesa. The reason it doesn't work on Nvidia doesn't have anything to do with Gallium though - Nvidia just doesn't support the extensions Zink requires, and it probably never will as that would require open sourcing a sizable chunk of the driver.

4 points

I see, so basically Gallium is not a driver, nor an engine, more like a library some implementations (API "drivers") can use. And Zink basically requires calls the Nvidia driver and / or libDRM does not support, so it wont work?

2 points

Gallium is a library, and Zink requires support for an API that requires GPL symbols in the kernel, and Nvidia doesn't want to release their kernel driver as GPL.

2 points

Zink isn't just OpenGL implementation but Gallium driver that produces Vulkan commands instead of device native commands. Gallium is a set of interfaces and libraries that sits between devices and APIs like OpenGL. There are some more interfaces like DRI etc. that are used by open source driver. If you are writing GPU driver you need to provide implementation for APIs like OpenGL. Because Mesa supports many different GPUs it would implement same thing for many devices. That's why Gallium was created. APIs (like OpenGL or Direct3D 9 with Gallium-Nine project) are implemented as state trackers for Gallium and Gallium is responsible to translate them to native device commands.

With this architecture you can use one state tracker for many different devices. All you need is driver with Gallium support. If you are running application (using OpenGL for example) then communication looks like this: Application -> OpenGL -> Gallium -> Graphics driver -> Hardware. Zink is implemented as Gallium driver so it doesn't implement OpenGL from scratch but implements Gallium and uses Mesa OpenGL state tracker like most open source drivers (AMD driver, new Intel driver, open source Nvidia driver etc.). With Zink same application would look like this: Application - > OpenGL -> Gallium -> Zink driver -> Vulkan -> Vulkan driver -> Hardware. As you can see, instead of going from driver to hardware, we are going from Zink driver to Vulkan and then to hardware with Vulkan driver.

There is one more thing worth saying - Vulkan isn't implemented as Gallium state tracker. Compared to OpenGL, Vulkan is already low level API and in facts it's even lower level than Gallium so it can't be implemented on top of it. Vulkan needs separate implementations for every device.

It doesn't work on Nvidia driver because its not using any of these interfaces. Nvidia has custom OpenGL implementation which uses different interfaces than Mesa drivers. Particularly Nvidia doesn't support DRI which is used by Mesa drivers and because Zink is one of Mesa driver that's why it fails. It would work fine if Zink would be simply Vulkan based OpenGL implementation like DXVK but it isn't. DXVK is a library which implements Direct3D API using Vulkan. Zink is Gallium driver. Even if they share similar purpose they are very different projects.

2 points

Good explanation, although it conflicts with the other guy in the comments claiming gallium has nothing to do whith zink not working with nvidia drivers, being instead due to some vulkan extension not being supported

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.