69 ms·
Vulkan1.3 on the M1 in one month
- dagmx 2y agoVery impressive work, and a great testament to the value of shared, iterative and open components. I'll be curious how long it takes Proton to be ported, though I suspect even with an optimal Vk implementation, many games will run terribly due to the difference in GPU architecture + arm translation overhead + proton itself (however negligible). Still, I remain optimistic that more games will target unified memory and ARM in the future on desktops, as SoCs become more prevalent like the snapdragon.
- rowanG077 2y agoA ton of games which don't require dxvk are running at 60+ FPS. See https://vt.social/@lina/112524118075585601 https://vt.social/@lina/112524118075585601 Alyssa, the machine that she is, has also been working on improving FEX performance recently.
- ricardojoaoreis 2y agoAlyssa did some work for Valve, they might have an interest in FEX for some ARM version of Proton. Good thing that we can all benefit from it
- elabajaba 2y agoShe left Collabora last year and now works for Valve as a contractor.
- talldayo 2y agoThere will be a small bit of irony if the gaming experience on Asahi ends up easier and more straightforward than MacOS. Really just drives home how big of a mistake it was ignoring Vulkan for the past decade on Apple's behalf, but lord knows they won't admit that until it's too late.
- rowanG077 2y agoWhy would that be ironic. Apple wilfully is holding gaming back on OSX by ignoring Vulkan and having a pure shit opengl implementation.
- bilbo0s 2y agoYou may have a good point with the opengl thing. But the number of games that run on Vulkan is so vanishingly small that we can't credibly say that not having a Vulkan driver holds Apple back on gaming. I'd bet any money that the number of games that work on Metal is wayyyy higher than the minuscule number of games that run on Vulkan. Which should tell you how few Vulkan games there are.
- talldayo 2y ago> But the number of games that run on Vulkan is so vanishingly small Really? 7 out of the 10 most popular games on Steam work fine if you have Vulkan 1.3 drivers: https://www.protondb.com/explore?sort=playerCount https://www.protondb.com/explore?sort=playerCount
- dagmx 2y agoof the top 10, I count 3: Counter Strike 2 Dota 2 Stardew Valley How are you getting 7/10 unless you're also counting games that happen to run under Proton, which aren't native? And regardless, that's a really small sample size to extrapolate from, when it's easy to get a more extensive list that is around ~250 games total. https://www.vulkan.org/made-with-vulkan https://www.vulkan.org/made-with-vulkan https://www.pcgamingwiki.com/wiki/List_of_Vulkan_games https://www.pcgamingwiki.com/wiki/List_of_Vulkan_games Of which, a massive percentage are based on engines that have Metal support as well.
- talldayo 2y agoI'm sorting by playercount, which seems to be corroberated here: https://steamcharts.com/top https://steamcharts.com/top I am counting Proton games because they very explicitly are supported by sufficient Vulkan coverage. In case you weren't paying attention that's kinda the only reason anyone cares about Apple Silicon getting Vulkan 1.3 coverage in the first place. > when it's easy to get a more extensive list that is around ~250 games total. You're right, when we push it out to 1000 titles it gets closer to 80% playable: https://www.protondb.com/dashboard https://www.protondb.com/dashboard > Of which, a massive percentage are based on engines that have Metal support as well. ...yeah, you keep telling yourself that. One day, they'll definitely flip the switch on MacOS support. Certainly.
- aurareturn 2y agoI wonder if this effort to add Vulcan to Linux and then translate DirectX in Asahi Linux would impact Apple's dream of landing AAA games on Apple Silicon. Apple would like AAA developers to port their AAA games over to Metal so that the game has one code base but can run on iPhones, iPads, Macs, and the Vision Pro. Perhaps Mac gamers will install Asahi Linux in order to play AAA PC titles.
- littlecranky67 2y ago> would impact Apple's dream of landing AAA games on Apple Silicon Apple's dream is not to have AAA games land on Apple Silicon - they can do this with Proton-like layer, like they did with GPTK. Apple's wet dream is to have AAA games land in the Apple App Store - not on Steam or Epic Game store. That is why the GPTK effort is only have assed (and the license prevents Valve integrating it into steam directly).
- babypuncher 2y ago> Apple's wet dream is to have AAA games land in the Apple App Store This is why their efforts are largely doomed. I'd love to play more AAA games on my Macbook, but too many of them require a separate purchase from the App Store to make that happen, rather than just putting the Mac versions on Steam alongside the Windows version. If you're going to make me choose between playing a game on my laptop and playing it on my gaming desktop, I will choose the desktop every single time. It would be nice to take more of those games with me when I travel, but it's not a frequent enough use-case for me to give up all the benefits of real PC gaming.
- littlecranky67 2y ago> This is why their efforts are largely doomed I'm not as certain about that as you are. I think there are - as always - different streams withing that mega corporation. It is probably sales-oriented people wanting nothing but AAA games on the App Store and be okay with the Mac not being a major choice for games if that doesn't happen. The other stream is probably more enthusiastic (especially with the Apple Silicon being "enough" gaming machines for 1080p@60) and wants to bring gaming over - that is probably the stream that made GPTK happen and give a licensing exception to crossover to be able to integrate it in their department. I'm in the later department, hoping we will see a proton-like GPTK that can run my steam library.
- drpossum 2y agoCan someone explain how this relates to MoltenVK? This just removes the need for it as it's a native driver?
- gary_0 2y agoThis is for Vulkan on Asahi Linux on M1 Mac hardware. MoltenVK provides Vulkan on top of Metal on MacOS.
- rowanG077 2y agoMoltenVK translates metal to vulkan. Metal is the main graphics API on OSX (and iOS). This is a native vulkan implementation on linux. The blog post itself mentions that as well. This can't run directly on OSX so it won't remove the need for MoltenVK.
- Tiberium 2y agoMoltenVK is an implementation of Vulkan based on Metal so that it can be used on macOS to run Vulkan applications. Asahi Linux is an in-development Linux distribution to make Linux compatible with Apple's M series processors. This specific blog post is about making GPU-accelerated Vulkan work on Asahi.
- AltruisticGapHN 2y agoAnd I think the point is they will then be able to support DXVK to run Direct3D games.
- pantalaimon 2y agoThis is about Vulcan on Linux, not macOS
- jandrese 2y agoTheir shaders contain a peculiar construction: if (condition) { while (true) { } } condition is always false, but the compiler doesn’t know that. What is the purpose of this other than to be a poison pill for people writing compliant shader compilers?
- tombh 2y agoIs this how shaders "panic"?
- zamadatix 2y agoIsn't the main point of tests to be poison pills for people writing compilers so they can ensure any shaders passed to the compiler don't break it? I.e. it's not that the specific code is useful as is in practice but if a chunk of a shader ends up functionally simplifying to something like this in a particular instance your shader compiler still needs to handle it right even though it could be written better at that point.
- JakaJancar 2y agoMaybe an edge-case in some codegen?
- nsajko 2y agoThe purpose of the construction could be to inform the compiler of the fact that the condition is always false, so as to enable the compiler optimizer more. Take a look at these features in C++, LLVM or Rust if you're not familiar with the concept: * https://en.cppreference.com/w/cpp/utility/unreachable https://en.cppreference.com/w/cpp/utility/unreachable * https://en.cppreference.com/w/cpp/language/attributes/assume https://en.cppreference.com/w/cpp/language/attributes/assume * https://en.cppreference.com/w/cpp/memory/assume_aligned https://en.cppreference.com/w/cpp/memory/assume_aligned * https://llvm.org/docs/LangRef.html#unreachable-instruction https://llvm.org/docs/LangRef.html#unreachable-instruction * https://llvm.org/docs/LangRef.html#llvm-assume-intrinsic https://llvm.org/docs/LangRef.html#llvm-assume-intrinsic * https://doc.rust-lang.org/std/hint/fn.unreachable_unchecked.html https://doc.rust-lang.org/std/hint/fn.unreachable_unchecked.... * https://doc.rust-lang.org/std/hint/fn.assert_unchecked.html https://doc.rust-lang.org/std/hint/fn.assert_unchecked.html The infinite loop is effectively an unreachable instruction (reaching it is not allowed), and an unreachable instruction behind a branch effectively becomes an assume instruction.
- gigatexal 2y agoWhen I grow up I want to be half as competent as her at programming. Holy smokes. Bravo.
- adastra22 2y agoIs any of this usable from within a VM? I dev on macOS and generally like it, but run a VMware image of Ubuntu for testing things. I do 3D graphics apps, and I’m not sure how good VMware’s pass through is. Is the Apple Silicon GPU virtualized in the VM? Could I run this distro and get better graphics performance?
- whitehexagon 2y agoAmazing, I'd only just updated for ES 3.2 support. It feels like my M1 was built for Asahi! although to be fair I only booted macos once on it, probably during install, or by mistake! Anyway great work! and nice to have these detailed updates. Are any browsers supporting 'zero copy rendering' or still layers and layers of compositor stuff going on? I seem to recall also getting stuck with webgl2 transform feedback triggering read backs.
- zamalek 2y agoIs it possible to remove MacOS entirely? This has me considering a mini for travel.
- IntelMiner 2y agoMacOS is still needed for the various firmware updates and other components. But the Asahi installer seems to shrink it down to about 30GB which is acceptable
- _mlbt 2y ago> It begins with a text. > > Faith… I think I want to write a Vulkan driver. > > Her advice? > > Just start typing. I love this part. It is such great advice and it applies to so many things that we want to do in life, but never start because we become paralyzed with fear due to what seems to be an insurmountable task.
- deleted 2y ago[deleted]
- vramana 2y agoExactly me feelings. I am inspired by the work Asahi Linux team publishes. As a full stack developer, I feel very very distant from this part of the stack. Everything looks like greek and latin. Reading this post gives me hope. May be I can someday understand how the drivers are written, I leave my fear and start writing and reading code.
- ekianjo 2y agowhy use Fex instead of Box86?
- rowanG077 2y agoBox86 can't run on apple silicon. There is no 32 bit support.
- tombert 2y agoA very large part of me is annoyed that Apple didn't open source Metal before Vulkan was released. OpenGL definitely was annoying to work with, but Vulkan is impossible for the average user to do anything with; drawing a spinning cube takes several hundred lines of code, which I've written and I still don't really understand! I realize that Vulkan isn't meant for a "humans" to write, it's basically meant to be a target, and that's fine, but it annoys me that you get people on forums that say "learn Vulkan instead" when people ask for help with OpenGL. Metal is substantially more fun to write than OpenGL or Vulkan; I haven't measured any performance stuff on it, but it certainly feels fast enough, and I've been able to do basic graphics experiments with it in way less time than I was ever able to accomplish with OpenGL or Vulkan. Still, whether or not it annoys me that Vulkan has become the new standard, portability of the standard is important, so obviously this announcement is a godo thing.
- deleted 2y ago[deleted]
- hgs3 2y agoPlease don't misinterpret this as gate keeping, but Vulkan is designed by and for professionals (not hobbyists). It is certainly not a rapid prototyping tool. Vulkan and OpenGL aren't comparable because Vulkan isn't merely a graphics API, but rather it's a low-level GPU API. For example you can use Vulkan in place of CUDA for running highly parallelized computations on the GPU (no graphics implied).
- tombert 2y agoYeah, I know, that's why I mentioned it being a target. I realize it's meant to be used for extremely low-level stuff. Which is fine, I don't get annoyed at x86_64 assembly being difficult to write. As I said, the thing that bothers me is when people act like Vulkan is a replacement for OpenGL (presumably because they've never actually written either and they just saw some YouTube demos), and it really isn't, or at least that's an incomplete picture. It's a replacement for OpenGL in the same way writing JVM bytecode directly is a replacement for Java; they fundamentally do the same or similar things, but one is sort of categorically different in its goal. I do wish that there was a more consumer-friendly API announced in addition to Vulkan though; I'm fine with replacing OpenGL with something newer and better-fitting for newer cards, but that's not what we got. That's why I was trying to say that I was annoyed that Apple didn't open source Metal, because I feel like it really could have taken that role. Also, while I'm aware that Vulkan doesn't inherently imply "graphics", I would also like to point out that CUDA and rocM are also considerably easier to write than the Vulkan equivalents, at least in the little examples I played with, though I will acknowledge that I felt Vulkan was better than OpenCL.
- throawayonthe 2y ago[dead]
- delta_p_delta_x 2y agoHacker News regularly makes me feel very stupid, and none more so than blog posts by Alyssa Rosenzweig. I couldn't even write an engine that used Vulkan in six months, nor a software rasteriser; meanwhile, Alyssa wrote an entire compliant driver on a non-native operating system running on locked-down hardware in one month flat. What am I doing with my life? EDIT: I point this out because I'd eventually like to write GPU drivers too, having been fascinated by video games since I was like three.
- wmf 2y agoYou're making wrong comparisons is what you're doing. If you had already written N game engines, could you write a new one in a month? Yes, right? Alyssa didn't spring from the head of Zeus fully formed; she has been developing GPU drivers for years. Pick something you want to work on and work on it for years.
- tcmart14 2y agoYes, definitely want to back this up. Alyssa is definitely a really skilled and competent engineer. But she also has years of domain knowledge she has built up. That isn't to knock down her skill, but more of, don't let it demotivate it you because it too also took Alyssa time to get where she is.
- fermuch 2y agoShe is also great at communicating her advancements, which is a greatly useful skill to cultivate.
- tcmart14 2y agoThat is something I was just thinking about a few moments ago. I've haven't watched any of Hector latest stuff if he is still streaming. But between Hector, Alyssa, and Asahi Lina, they all 3 are pretty motivated and pretty excited to share. Which is great and something I wish we had more of. It helps to demystify these systems some. For many, GPUs and graphics APIs are just black boxes of magic and it can be hard to get past that. But content like this helps to remove the black box and make it more approachable.
- exDM69 2y agoIf you're unfamiliar with Vulkan 1.3 but are interested in low level graphics API work, you should check it out. It is a game changer and a huge difference to Vulkan 1.0. Once past the initial hurdle it's a pleasure to work with, with all dynamic states and no render pass up front set up, it is much easier to work with, even easier than OpenGL (which I've used for 20 years). Graphics programming is fun again. It's available, or at least most of the features, on all desktop platforms with GPUs less than 10 years old give or take as long as drivers are up to date. Unfortunately there is no "reasonable defaults" framework to get you off the ground but there are a lot of useful helper libraries for several languages.
- HexDecOctBin 2y agoIs there any tutorial/documentation to get started with Vulkan 1.3 specifically? Last time I looked, all I found was a hodgepodge of techniques using old and new methods haphazardly in various combinations. Though that is exactly how OpenGL used to be, so maybe the apple (heh!) doesn't fall far from the tree. Well done, Khronos...
- eliasdaler 2y agohttps://vkguide.dev/ https://vkguide.dev/ is fantastic.
- masfoobar 2y agoThank you -- I appreciate this comment. I have "dabbled" in OpenGL for 20 years. I am not a pro games programmer, but I do make 3D content for fun in my spare time. One thing I have not had time is converting over to Vulkan. I guess I just need to pass the init and setup hurdle. I do think once I pass that, there is no going back (to OpenGL) Point is - your message was a little inspiring.. kinda triggered a part of my brain to do it. Have a good day.
- andrewmcwatters 2y ago[flagged]
- machine_coffee 2y agoSomething crashes, it's _never_ a compiler bug ... April 16 Oh, it actually is a compiler bug! Can confidently say I've never experienced one in my career, but at some level of abstraction I guess it's less rare to find them.
- anyfoo 2y agoIt's never a compiler bug, and it's definitely never a CPU bug. Unless you're a low level kernel developer, then it's both! (Jokes aside, it's still much, much more often not than it is, but it definitely does happen.)
- mschuster91 2y ago> Unless you're a low level kernel developer, then it's both! Or you're working in cryptography code and have to fight against compilers optimizing away sensitive stuff [1] - or adding junk back in [2]. [1] https://www.redhat.com/en/blog/security-flaws-caused-compiler-optimizations https://www.redhat.com/en/blog/security-flaws-caused-compile... [2] https://pqshield.com/pqshield-plugs-timing-leaks-in-kyber-ml-kem-to-improve-pqc-implementation-maturity/ https://pqshield.com/pqshield-plugs-timing-leaks-in-kyber-ml...
- mort96 2y agoI mean she wrote the compiler didn't she? At least the register allocator part "It's never a compiler bug" doesn't really apply when it's your own work-in-progress compiler you're testing...
- RecycledEle 2y agoI assumed this means a ULA rocket would be transported down a British highway.
- mschuster91 2y ago> Some formats are implicitly reordered. Common “BGRA” formats swap red and blue for historical reasons. JFC that brings up nasty memories dealing with OpenCV. One might think this kind of stuff would be solved by now and people would have converged on something sane, but no, it isn't...
- TheAmazingRace 2y agoAlyssa strikes again with some amazing coding wizardry. I don't know how she does it, but I'm glad she's fighting the good fight.
- signa11 2y agothis: ''' April 16 The tests for “descriptor indexing” revealed a compiler bug affecting subgroup shuffles in non-uniform control flow. The M1’s shuffle instruction is quirky, but it’s easy to workaround. Fixing that fixes the descriptor indexing tests. ''' is just bonkers !
- jerry22 2y ago[dead]