if you think about it, vulkan logical device implies the existence of vulkan illogical device

I'm slowly working through the vulkan spec writing a compute-only vulkan program from scratch that doesn't render anything, and it's going pretty well because the spec is really well written and I already know more or less exactly what I want to do anyway, but I just want to say just how silly (fun) it feels to write a program like this because you get to just skip over large swaths of the API.

Like, I'm working from the spec because the tutorials all make it more complicated.

also the tutorials I reviewed all did the annoying thing where the tutorial squirrels away the stuff you're trying to learn or reference into abstractions that only serve the needs of the tutorial writer, which given my goal is very specifically to *not draw anything*, there's really not much of a point to any of them lol. I'm really not the intended audience here though :3

I think it's cute that practically every vulkan command has one or more optional args to let you enter Hard Mode

(sorry for the double post, I added this to the wrong thread)

ok even with just the compute-only subset vulkan is a slog D:

I wonder how many people have actually managed to knuckle down and write a complete, useful vulkan program from scratch (no copy pasting from tutorials and stack overflow, no offloading significant parts to 3rd party libraries like VMA)

To think if I power through and get this thing working I could potentially be like the 20th person to bother

@aeva I can say with all certainty that I didn't try either
@efi see, you're the smart one here,
@aeva well, considering my game engine is now retro before even being beta idk lmao
@aeva this kind of thing was a big motivation for me making Gigi. So we sit and take a month to get to the first triangle in vulkan, metal, dx12, etc.
If we did it right we end up with the same code everyone else has.
There is so much boilerplate.
Literally saying "run these shaders with these inputs and outputs" is enough for a person knowledgeable about any platform to make it happen.
There is no reason for all the hoop jumping other than a knee jerk reaction to devs calling drivers slow.
@aeva when people point at an api or engine interface and ask "why is this such a pain in the butt?" And the response is it has to be, I want people to be able to point at gigi and say "No, look. This other interface is just as descriptive. It can generate all the code you want me to write by hand, and writes it the way I want it to be and you want it to be, but i don't have to write a novel to express a sentence".
Besides being useful, I hope gigi starts a conversation about complexity.
@demofox so, if I'm following this, I can use gigi to describe a compute shader in a reasonable way, and use it to generate the vulkan code for all the shader management stuff?
@aeva it doesn't have vulkan code generation yet unfortunately. It's basically just me working on it so it's slow going development.
Publicly only dx12 right now. A couple more weeks (estimated) until webgpu/javascript (browser and node).
Internally at EA we also have code generation for UE5, frostbite, and a light weight research engine.
UE5 could be public but needs a little more work til it's ready for that.
Vulkan is next on the list after, I'd say, since it opens up so many more platforms.
@aeva but yeah, that's the idea!
You can string a bunch of nodes together in a node graph, where each node is a compute shader, ray gen shader, draw call, copy resource etc.
You can see it running in the viewer where you iterate (hot reload), profile, and debug (view any resource at any stage).
When you are done, you code generate and it gives you the cpu side code, and the shaders, with instructions for hooking it up.
It makes a modular thing and tries to minimize effort in connecting it up.
@demofox if only we had GPU drivers for Plan9.
@Flux @demofox you should simply add GPU drivers to Plan9!
@aeva @demofox I've worked too close to GPUs to think of this as a feasible single-person project.
@Flux @aeva what is plan9? Google isn't helping much
Plan 9 from Bell Labs - Wikipedia

@dougbinks @demofox @Flux @aeva it’s the future!
@photex @dougbinks @demofox @Flux @aeva and it always will be
@photex @jon_valdes @dougbinks @Flux @aeva i took your comments more seriously and was intrigued 😂
@demofox there's a lot of goodness in a plan9 approach to problems. Worth booting it on some old hardware and getting familiar with it, if only to realize the whole world doesn't need to be windows and Linux.
@demofox @photex @jon_valdes @dougbinks @Flux there are a lot of cool ideas in it though, worth reading about, probably also worth playing around with

@aeva @demofox @photex @dougbinks @Flux
absolutely. It is a pretty cool design.

It is a bit sad that OS design has evolved so little in the last 30 years that Plan9 still feels "out there", though :(

@aeva @demofox @photex @jon_valdes @dougbinks These days I recommend the 9front variant. Modern device drivers, some innovation in the core system (the boot management is actually *nice*), and an active community.
https://9front.org/
#9front #plan9front
9FRONT.ORG THE PLAN FELL OFF

@photex @dougbinks @demofox @aeva It's what the future used to look like!
@Flux @photex @dougbinks @demofox it quietly lives on in significant ways - WSL2 uses some plan9 stuff for sharing files with windows https://superuser.com/questions/1749690/what-is-this-weird-process-i-see-in-wsl-called-plan9
What is this weird process I see in WSL called “plan9?”

I'm using WSL2 with Ubuntu on Windows 11 and there is a weird process called plan9 I see with htop. Here is a picture of it. ps ax output: 4 ? Sl 0:00 plan9 --control-socket 5 --log-lev...

Super User
@demofox oh... how long will it take for you to do all that 😅
@aeva lol. Yep.
Gigi is super usable right now for rapid prototyping, research things, and dx12 code generation.
We (people in seed, some others in EA, and some people outside EA) use it daily for this stuff and gigi generated code is in the wild.
Webgpu (javascript) is a couple weeks away.
No idea how long til vulkan would be in.
I have important blue noise stuff to do too 😭
If i had my wish thered be a couple other people working on it with me full time and we'd get vulkan in next.

@demofox that makes sense. I think they should let you hire some minions, that's a lot for one person to do.

What sort of blue noises are we talking?

@demofox I will say this: OpenGL's model of compiling shaders is *wrong* but OpenGL's model of binding resources to shader programs is Correct. Vulkan's model of compiling shaders is slightly less wrong, but their model of binding resources to shader programs is OH MY GAWD (insert all the question words here)
@aeva who is vulkan made by/for? is it architected by like the chip designers without input from users?
@hipsterelectron it's an industry standards body of hardware and software vendors. Vulkan started off as a proprietary low level hardware API called Mantle which AMD donated to the Khronos group. This did meet a need at, because specialized game engines can make use of APIs like this to minimize driver overhead among other things. Before Vulkan you could only really do that with proprietary game console rendering APIs.

@hipsterelectron the downside though is it's exquisitely verbose and filled to the brim with footguns that are not likely to be obvious without some kind of relevant experience.

The situation is a bit better now because there's a number of great high quality libraries for doing various common tasks that compose well with one another, but I don't think we're quite at the point where it can fill all of OpenGL's niches yet.

@aeva it's also so verbose to please the hakf dozen IHVs who all have different underlying models.

I miss OpenGL ES.

@aeva SYCL was like this too i think
@aeva very hopeful for rustsycl
@hipsterelectron I'm not familiar with SYCL. Looks like OpenCL but with C++17 instead of glsl?
@aeva yep!!!! super fucking cool and i think it gets much closer to the right way to do parallel computation. LLNL's RAJA (super fucking cool parallelism framework in c++, i wanna do it in rust but you actually can't express a lot of it in rust bc c++ has a better type system in several ways) uses it as a backend
GitHub - LLNL/RAJA: RAJA Performance Portability Layer (C++)

RAJA Performance Portability Layer (C++). Contribute to LLNL/RAJA development by creating an account on GitHub.

GitHub
@aeva rly rly rly rly good deconstruction of the limitations of the rust type system vs c++ here from the eng who was gonna keynote this at rustconf before getting sidelined by a known bad actor https://mastodon.social/@tedmielczarek/114101345156483840
@aeva i'm gonna apply to present at rustconf and hope to clown on them
@hipsterelectron fascinating read! I'm sure this would have been a fantastic keynote, assuming you're allowed to say positive things about C++ at rustconf

@aeva this is actually one of the main things I've found myself praising Metal for as it seems so so much more concrete in its design guiding you towards how to do things rather than feeling like a pile of APIs without coherent and obvious bonds.

I could probably write a small little Metal app from scratch but I could never see myself doing that with Vulkan without at the very least using a helper wrapper library

@aeva tbh I tuned out of graphics APIs completely when webgl2, vulkan, metal, and webgpu all came out around the same time while at the same time Apple deprecated opengl

I dont have time for that shit

@aeva hmm how useful is "useful" :') but to be honest I think the hardest part of vulkan is actually the same as opengl, it's knowing which set of extensions you're supposed to use because they make things much easier, and which extensions you're not supposed to use because they're pointless or not practical on the hardware you care about.
@aeva e.g. you can skip pretty much all the shitty binding APIs in vulkan if you want, which makes things better in many ways (but still complex)
@dotstdy what would you say are the good extensions? (keep in mind I'm not rendering anything, just doing compute)
@aeva buffer device address for starters
@dotstdy what's the extension name
@aeva https://registry.khronos.org/vulkan/specs/latest/man/html/VK_EXT_buffer_device_address.html (it's actually standard in Vulkan 1.2, and mandatory for Vulkan 1.3, but that's more or less the same problem as extensions at least until everyone is on board with the new hotness)
VK_EXT_buffer_device_address(3)

@dotstdy gotcha. maybe I should read through everything that got added to core between 1.1 and 1.4 (which is what my laptop supports)...
@aeva yeah, the other big one that comes to mind is https://github.com/KhronosGroup/Vulkan-Docs/blob/main/proposals/VK_KHR_dynamic_rendering.adoc but that's not relevant for compute. it just means less pointless boilerplate (okay, technically the boilerplate has a point if you're trying to soup up a mobile renderer, but i'm not) on doing graphics.
Vulkan-Docs/proposals/VK_KHR_dynamic_rendering.adoc at main · KhronosGroup/Vulkan-Docs

The Vulkan API Specification and related tools. Contribute to KhronosGroup/Vulkan-Docs development by creating an account on GitHub.

GitHub
@dotstdy this was a huge help :) ty for the tip
@dotstdy re "useful", whatever comes past the "could a depressed person do this" joke, I guess? I figure there's plenty of people out there who have probably managed to power through a tutorial and get the triangle one screen, and then just... quit. That's not "useful", right? That's just sad, because that means the experience was an ordeal, not a useful learning exercise. If learning how to draw a triangle is enough to crush someone's dreams, that's not "useful", right?
@dotstdy However, what I want to write is more or less in the same ballpark of complexity as drawing the victory triangle, because it's a relatively simple gpupu task, but if I get it working (and the experiment is successful), then it will be "useful" because the result will be a program that I will actually use for something (making music), and will inform decisions made on a bigger project (synth engine for a game). If I stop short of that, it will not have been "useful".
@dotstdy I guess what I'm trying to say is I'm not setting a goal post of some sufficiently Macho amount of program complexity that one has to cross to be a Vulkaneer, because that would be stupid and shitty. Rather, I'm wondering how many people have managed to raw dog vulkan and not come away with the conclusion that maybe it would be best only write this if someone's paying, or worse, that whatever it is they wanted to do is simply just beyond their capabilities
@aeva oh yeha for sure. especially the last point. i have indeed 'raw dogged vulkan' but not because i think the api is good to use, more because it's the only usable api on Linux (well arguably the best option on linux is actually dx11 via dxvk but yeah). it certainly has its attractions, but a lot of things (especially stuff like allocation) end up being entirely busywork for no significant gain - even at AAA scale.
@dotstdy @aeva we use it through wgpu_native. a treat