#
…

2022-10-02

00:05yuyichao_ has quit [Quit: Konversation terminated!]
00:50alyssa..part of me wants to support g13p just for the lulz
00:50alyssa(A14 iPhones)
00:51alyssaI'm under the impression iOS apps can talk to the AGXAccelerator IOKit service themselves (based on project 0 reports I've read) making that technically possible,
00:52alyssathough maybe it's sandboxed and just has a WebKit exception that's used in those exploit chains..
01:11yuyichao has joined #asahi-gpu
01:19yuyichao_ has joined #asahi-gpu
01:23yuyichao has quit [Ping timeout: 480 seconds]
02:20chipxxx has quit [Read error: Connection reset by peer]
03:38kov has quit [Quit: Coyote finally caught me]
05:08appleboy711[m] has joined #asahi-gpu
05:10appleboy711[m]I wonder how the M2 GPU reverse engineering is going.
05:44joske has joined #asahi-gpu
05:45joskejannau: thanks! I can try it tonight after the kids are asleep 😉
06:22SSJGZ has joined #asahi-gpu
06:34bisko has joined #asahi-gpu
06:46bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:04joske has quit [Ping timeout: 480 seconds]
08:56jannaualyssa: not far off from my background in video/multimedia
08:58jannaulina, alyssa: driver is stable enough for > 1h of video playback in firefox
08:59aris the "rebooting the gpu on every frame" hack still in place?
09:02jannauyes, no updates since the last stream. demo is working for xdc don't expect updates until after
09:05ari'm honestly amazed it works so well
09:17goldsoultheory has joined #asahi-gpu
09:43chipxxx has joined #asahi-gpu
10:39linaYou mean as smooth as it does? Thank Apple's awesome PM ^^
10:39linaIt being stable is no surprise though, it's a great way to clear cached state
10:40linaBy the way, we have at least one other user running the crazy it-works branch. I told her to just make a laundry list of what apps are broken, so we can go through it at our leisure as we get to fixing things.
10:43Ella[m]I'm going to be trying to get my vulkan driver working on it next tuesday
10:45linaThe uAPI needs a full revamp to really support Vulkan, but I guess you should be able to test basic rendering jobs as is? Just keep in mind the Z clipping is hardcoded to OpenGL mode right now...
10:45linaYou need to flip bit 0 to 0 for non-GL Z clip (I need to move that into the uAPI ASAP...)
10:46linaElla[m]: Thank you for working on this! Having a Vulkan implementation (even if incomplete) is going to be super useful to make sure we don't mess up the real uAPI design ^^
10:50Sobek[m]Is the uapi of the GPU drivers covered by the stability guarantees in linux releases? Is introducing a new uapi version associated with a newer and better driver for the same hardware, with coordinated changes in mesa, something that happens regularly?
10:51linaYes and not really, which is why it's important to get this right the first time!
10:52linaIt's also why I don't think this driver is going to be upstreamed any time soon, because rushing it makes no sense. I want to see GL 3.1 and OpenCL and at least some Vulkan running before we even attempt it.
10:52linaBut that's okay, it can live downstream for a while!
10:53linaI had a long discussion with jekstrand and alyssa about uAPI design, so I have a good plan I think... but I really want to see it proven before we jump to upstreaming!
10:54linaThe current uAPI is just a demo, so all of that is going away entirely.
10:56linaFor now, the first step is to just move into the uAPI all the registers that GL actually needs to pass the CTS (and also that GL mode bit). Most of that render command design can carry over to the real uAPI progressively.
10:56linaBut the way the driver does memory management, queue allocation, waiting, and scheduling is going to be completely redesigned for the real uAPI
10:57Ella[m]<lina> "https://github.com/AsahiLinux/..." <- I'll probably just flip it in the kernel when I'm testing next week. I want to try and get some basic WSI stuff working but I shouldn't need OpenGL at all for that.
10:58linaSounds good! It's just Z clip so if it's wrong you'll just get messed up clipping, it won't otherwise break everything. When I tested GL mesa on non-GL mode, I was getting half a cube. Vulkan on GL mode is probably just the opposite, so it'll probably display fine as long as nothing is behind the camera?
11:00Ella[m]probably
11:05skoobasteeve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
11:06skoobasteeve has joined #asahi-gpu
11:13skoobasteeve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
11:13skoobasteeve has joined #asahi-gpu
11:26goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:28goldsoultheory has joined #asahi-gpu
12:09joske_ has joined #asahi-gpu
12:09joske_OMG it works!! Thx lina, thx jannau!!!!
12:10joske_running gnome-shell --wayland from the console on 16GB M1 MBA
12:10joske_booted from u-boot
12:11joske_is there a trick to get lightdm to startup at boot?
12:11alyssalightdm will be broken
12:12jannauthere is afaik no session manager which doesn't use X
12:12joske_oh, ok, no worries then
12:12danielsgdm is Wayland-native
12:12joske_oh and thx alyssa too!!!
12:13joske_funny but in mate terminal (when running in wayland?) everytime it gets focus, the window shrinks a bit :-D
12:14joske_ has quit []
12:14alyssaI do wonder how I managed to break glamor on this driver
12:14karolherbstheh... I know there are some funny things going on in gnome where stuff depends on correct rendering, otherwise it just doesn't work...
12:14jannaudaniels: good to know
12:15alyssaon Bifrost it was lack of register spilling that bit me, but AGX has twice as many registers available to a single thread, so that should be ok
12:15karolherbstlike in the past there was screwed up colors for big endian systems and besides just everything having the wrong color, the UI didn't work at all
12:15alyssalot of real control flow in the shaders but we're passing everything relevant in deqp-gles2 so I don't think that's it, the control flow handling we have now is suboptimal but "obviously" correct
12:16karolherbstfamous last works
12:16alyssabased on the corruption I saw in the images I'm more inclined to blame a GL driver bug than a compiler one
12:16jannauresizing weston-terminal inside weston behave strangely as well. window border not at the same place at the mouse cursor
12:16alyssaoh, hhhh I wonder actually
12:16alyssawonder if modifiers are botched
12:16jannaus/at/as/
12:17alyssaobviously there's no DRM modifiers on macOS so that code is all untested up until now
12:17danielskarolherbst: mutter used to do window picking by rendering with solid colours and reading back, but not for a while now
12:17karolherbstyeah.. maybe it's fixed now
12:17alyssadaniels: sorry what
12:17alyssathat's... novel...
12:17karolherbstalyssa: well.. try to come up with _good_ reasons why rendering wrong colors makes the UI break like completely :P
12:18karolherbstand with completely I mean: you can't do anything except looking at the screen
12:24alyssathis is wrong
12:24alyssafor debug I would "assert(whandle->offset == 0);" there to see if that's causing any issue
12:26danielsalyssa: it’s actually less uncommon than you might think - or was at least
12:26alyssaI don't think it's uncommon, I'd just like to know if that's causing people's problems ;)
12:29alyssathis depends on (handle->layer == 0)
12:30alyssaalso seemingly missing "handle->format = rsrc->layout.format;" there
12:30alyssaor maybe "handle->format = rsrc->base.format;" ... would need to think for a bit to figure out whether the difference matters
12:30alyssa(I think no because you can't share depth/stencil targets across process boundaries so we should be ok)
12:30DarkShadow44 has quit [Quit: ZNC - https://znc.in]
12:30DarkShadow44 has joined #asahi-gpu
12:32alyssaalso seemingly missing "handle->size = rsrc->layout.size_B;"
12:32alyssamissing assert(level == 0) here
12:34alyssathis loop is fundamentally bogus and will return modifiers that aren't actually valid
12:34alyssaneed to split out 2 functions:
12:34alyssabool agx_linear_allowed(const struct agx_resource *pres) {
12:35alyssa return pres->base.target == PIPE_BUFFER || agx_is_2d(pres->base.target);
12:35alyssabool agx_twiddled_allowed(const struct agx_resource *pres) {
12:35alyssa return true;
12:35alyssaok i guess the second function isn't needed
12:35alyssaand then there are two distinct cases
12:36alyssathe first is when WE select the modifier, in which case it's just the logic without the for loop on top
12:36alyssaand at the end can assert
12:36alyssaagx_linear_allowed || modifer != LINEAR
12:36alyssaagx_twiddled_allowed || modifer != TWIDDLED
12:36alyssathe second case is when the CLIENT selects the modifier, in which case we have to pick from that set conditional on those allowed checks
12:37alyssathis if-stmt is way too late
12:37alyssaagx_twiddled_allowed should then have
12:38alyssa!(pres->base.bind & (PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_LINEAR))
12:38alyssafor PIPE_BIND_SHARED, we can and should twiddle
12:39alyssa(DISPLAY_TARGET is mostly for software rasterizers but we can't delete it because reasons, SCANOUT is for buffers shared with the display/dcp, SHARED is for buffers shared across processes like window surfaces, LINEAR is an old hack that won't die)
12:40alyssathis should only be for DISPLAY_TARGET, it can and will break for SCANOUT and SHARED which can't go through the displaytarget path
12:46alyssathough I don't think that last part will actually matter because winsys will be NULL on linux
12:48alyssathe modifiers thing is the most fundamental breakage here but yeah
12:59svenCode review via irc? :D
13:35linaI don't know what I'm doing with mesa anyway, I just copied and pasted bits of Panfrost code so I'm not surprised it's broken... ^^;;;
13:41alyssalina: also assuming the panfrost code is correct... brave
13:58karolherbstwhat are those registers GL needs btw? Do you have some other ways of accessing that besides adding ioctls? Or is that mostly in the "context initialization" area?
14:07linaThey'd just be fields in the render struct. It's job data like everything else already there.
14:08linaIt's just that we're still figuring out what fields of the corresponding giant firmware render structures actually need to be exposed to userspace and which don't.
14:08karolherbstmhhh, normally I'd expect that userpace just fills command buffers, sends that to the kernel driver and that's it. But it kind of sounds like that doesn't really exists here?
14:08linaIn this case we've been learning that some of those fields correspond directly to hardware registers (some of them fully or partially match PowerVR registers...), and since that ABI is dictated by hardware and therefore fixed, it's safe to expose to userspace directly.
14:09karolherbstand it's more like filling actual structs with data do describe jobs, is that correct?
14:09linaIn this case the kernel fills command buffers because Apple decided to architect their firmware such that those command buffers have to be trusted.
14:09karolherbstyeah okay, that's.. problematic
14:09linaWell, it's not really problematic, it's just... annoying
14:10linaUserspace still fills the actual draw/shader bind/etc command stream of course
14:10linaIt's just that the fixed-sized, job description structures need to be populated by the kernel, partially from userspace data
14:10karolherbstthe hardware I know is more flexible. E.g. on nvidia you can assign "classes" to context which have priviliged access, which the kernel only allows for itself, and userspace can only allocated classes without special priviliges
14:10linaSo we make up an arbitrary uABI for that to contain the data we need, and the kernel just copies it over to the firmware structs and fires the job
14:10karolherbstyeah, that's not as terrible as I initially thought then
14:11karolherbstso you can batch multiple render jobs into one submission and the kernel just sanitizes, submits and fence it
14:11alyssakarolherbst: Nothing to sanitize
14:11linaDepends on what you mean by "render job"
14:11alyssaour submit ioctl has fields for the registers that userspace is allowed to set
14:11karolherbstright.. I meant it more like error checking and filling out proper structs
14:12alyssa(all render pass config)
14:12linaalyssa: There are some things to sanitize (e.g. not exceeding max # of attachments), but it's fairly obvious stuff.
14:12karolherbstlina: one shader invocation
14:12alyssalina: Oh. Delight.
14:12karolherbstlike "draw this shader pipeline"
14:12linakarolherbst: Ah yes, you can do that as many times as you want.
14:12alyssaIs that actually a security issue though? Why does kernel need to sanitize?
14:12linaOne job submission to the kernel = one batch of rendering to the same set of render targets
14:12alyssaHow is that different from any other invalid cmdbuf that userspace can prepare and that GPU will fault on
14:12linaIf you switch render targets, that does need a separate job
14:12lina(Because this is a tiler)
14:13alyssalina: "one batch of rendering to the same set of render targets" is called a render pass :)
14:13linaalyssa: The kernel needs to copy the attachment list over for one, but I also don't think the firmware will appreciate the count being > the list size
14:13karolherbstso as long things stay simple it's fine, but if games switch the render targets often it's bad
14:13linaThat's the only variable length structure involved here that I can think of though.
14:13karolherbstthough usually command buffers get that huge that flushing is a must anyway
14:13linaEverything else is static
14:13alyssalina: Yeah, that's fair ... I guess supplying bad data to firmware is different than supplying bad data to hardware
14:13alyssagiven the trust model
14:13linaSupplying bad data to firmware crashes the GPU and your entire machine in practice...
14:13linaSo yeah
14:13alyssayeah okay
14:13alyssadelightful.
14:14karolherbstat least for GL that's easy to solve
14:14karolherbstfor vulkan.... it's super annoying
14:14karolherbstyou will have to workaround that limit
14:14alyssawhat limit?
14:14linaI think separate submissions per render pass is typical for all tiled architectures?
14:14karolherbstattachment lists
14:14linaI don't think AGX is special here
14:14linaWait what's hard about attachment lists?
14:14alyssayeah i don't see the problem either
14:14karolherbstyeah.. it's not special, but vulkan allows application to construct cmd buffers directly
14:15karolherbstand submit them explicitly
14:15goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:15karolherbstso you have ot make sure the kernel accepts all of them
14:15karolherbsteither you split it up or something else
14:15linaYeah but userspace will know about the max ahead of time
14:15linaEvery GPU has a max # of render targets, right?
14:15linaI don't think this is special
14:15goldsoultheory has joined #asahi-gpu
14:15karolherbstwell... depends
14:15karolherbstnvidia doesn't because it's all done in the command buffer
14:15linaApple lists those limits in a big PDF somewhere
14:16karolherbstswitching render targets is just a command
14:16linaYes, but there is a max # of *simultaneous* render targets
14:16linaAs in MRT
14:16karolherbstwe do have more virtual limits, like the amount of bos allowed to use in a submission, but that's pretty much it
14:16linaOf the same dimensions
14:16goldsoultheory has quit []
14:16linaRight?
14:16karolherbstright.. hardware limitations exist and those are usually exposed in vulkan as limits
14:17linaYou can do as many render passes to as many separate sets of render targets as you want in AGX, each one just has to be a separate job submission
14:17karolherbstyeah... just means that you will have to do multiple submissions when submitting a vulkan cmd buffer
14:18linaSure, but that's life for tiled architectures...
14:18karolherbstand make sure each batch is correct while recording
14:18linaI mean you need to make sure everything submitted is correct anyway, you wouldn't want to feed the kernel something it rejects at any point
14:18karolherbstI just never had to deal with those problems myself :D
14:18linaThat's a bug in mesa
14:18karolherbstwe don't have that in nvidia
14:19linaYeah but I'm sure you have hardware limits that cannot be exceeded for correct output, right?
14:19karolherbstthe only reason the kernel rejects is if the context crashes or we run out of memory
14:19linaNo difference to this ^^
14:19karolherbstthere is no metadata attached when doing submissions
14:19karolherbstit's literally just memory
14:19karolherbstbut yes, we have to make sure in userspace to not cause the context to crash, but that's something the kernel isn't involved with
14:20linaBut the command buffers themselves are going to be full of fields telling the hardware what to do... what's the difference between the kernel rejecting your command buffer and the hardware bugging out? Both indicate the driver did the wrong thing and allowed something to go through that isn't allowed.
14:21karolherbstright, not saying they are fundamentally different, just some hardware doens't need anything to be configured on the kernel side for things to run
14:21linaYes, this is funny hardware ^^
14:21karolherbstnvidia does all of its submission in userspace even
14:21linaI'm just saying this isn't a big deal in the grand scheme of things, as far as hardware differences go
14:21karolherbstat least for vulkan and compute
14:22karolherbstyeah.. probably
14:22goldsoultheory has joined #asahi-gpu
14:22alyssayes, NVIDIA's hardware is the most perfect thing in the universe, everything else pales in comparison, we all know, jekstrand won't stop talking about it :-p
14:22alyssaas far as gripes I have with AGX, this is not one
14:24karolherbstthough my hope is to get to know more about other hardware with my CL work
14:24alyssaAGX is a bog standard tiler
14:25alyssaalthough it's unique in how much it does on the shader cores and how little fixed function hardware it has
14:25karolherbstyeah.. I've heard
14:25alyssaeven relative to powervr
14:25karolherbstprobably makes sense to some degree being more flexible here as you know input/outputs are just memory anyway
14:26karolherbstthough implementing geometry shaders sounds like pain on agx?
14:26linaEveryone knows Intel GPUs are the best and most perfect GPUs ^^
14:27karolherbstI don't think I ever heard anybody at Intel saying that even
14:27karolherbstbut I also never talked to actual hw engineers at Intel
14:27karolherbstat least modern intel GPUs are all scalar, finally
14:27lina(That was a joke, click the link. That's my favorite WTF hardware graphics bug I saw while looking at GPU drivers.)
14:28linaI have no idea how that even happens.
14:28alyssalina: honestly the linked code seems mild by hasvk standards
14:28karolherbstlina: usually by hw engineers getting too nifty
14:28alyssa(The hasvk driver recently branched off anv, it's because Haswell can haz vk)
14:29karolherbstthere is probably some good reason behind it once you hear the reason, but a totaly mystery for anybody else
14:29linaThe addresses are so random...
14:29alyssakarolherbst: no! bad! you're thinking about good hardware design, stop it!
14:29karolherbstlina: yeah.. until you hear the reason
14:30alyssait's my understanding intel's gfx hw is some of the most pathological in the industry
14:30DarkShadow44 has quit [Quit: ZNC - https://znc.in]
14:30alyssaat least historically... IDK if gfx12 is any better in practice
14:30DarkShadow44 has joined #asahi-gpu
14:30karolherbstauto vectorization is a religion at intel
14:31karolherbstthat's the reason they got vectorized ISAs for that long
14:31karolherbstsome ditched them 15 years ago
14:31karolherbstnot sure when intel went full scalar though.. gfx9?
14:32alyssamost GPU ISAs are vector at least a little bit
14:32karolherbstoh sure.. for memory
14:32alyssalina: ^ if you haven't seen that thread it's good for a laugh
14:32karolherbstbut intel went this insane way where compute and something was scalar, but the other stages vectorized
14:32karolherbstit's really idiotic
14:32karolherbstalyssa: yeah.. very good thread
14:33karolherbstthere is even this joke story about intel engineers trying to beat cuda by using auto vectorization
14:33alyssa"Intel's [GPU ISA] is basically designed to keep CS PhD compiler engineers entertained solving unnecessarily hard problems"
14:33linaWhat is Arduino?
14:33karolherbstand asked "how did nvidia solved this issue" - "they didn't, they don't use vectors" - "sure, but how did they solve auto vectorization?"
14:33alyssalina: mispelling of Adreno, qualcomm's thing
14:33linaOhhh wwwwwwwww
14:34sven„at the bottom of the pile… Broadcom“ what a surprise! :p
14:34karolherbstthat's also one reason why CL is so inherently bad most of the times
14:35karolherbstpeople don't write scalar applications, they make have use of vectors and it sucks
14:35karolherbstanyway, that blog post sums it all up nicely
14:36alyssasven: we don't talk about broadcom, no no no...
14:41karolherbstwhat's that about broadcom?
14:41alyssakarolherbst: y tu, de ti, ni un sonido saldra!
14:41alyssa(sorry I don't know the lyrics in English)
14:42karolherbstanyway.. hw design matters for writing good driver impls, and some care less than others
14:49alyssa[Apparently "hey sis, I want, not a sound out of you" ... less dramatic than the Spanish :p]
14:50bisko has joined #asahi-gpu
14:50* karolherbstgoes into panic mode because flight preparations
14:51karolherbstI had the smart idea of taking a flight at 6 am
14:54karolherbstyeah... so my plan was to try to stay awak over the night and sleep on my flight to the US
14:54karolherbstlet's see how that all goes
14:55alyssagood luck
14:58svenim just amazed how everything Broadcom makes seems to be horrible
15:01Ella[m]from the work I've seen from v3dv, I second that
15:02alyssaElla[m]: We really should come up with a plan for getting agxvk into shape.
15:02alyssaDefinitely want a New Vulkan(TM) driver instead of Old Vulkan
15:03alyssaCommon vk state tracking + common vk_meta
15:03Ella[m]yes, I've made some notes on what order I want to do things in and I've already integrated the new state tracking stuff
15:03alyssaand possibly also pure dynamic rendering with common render pass emulation, but we're still trying to figure out if that can be made to work efficiently with tilers
15:03Ella[m]That's what I've been doing so far
15:05Ella[m]pure dynamic rendering
15:05alyssaThe trouble is that you leave a lot of perf on the table for renderpasses with multiple subpasses
15:06alyssaElla[m]: BTW, do you have Khronos access? (maybe through Igalia?)
15:07Ella[m]No I don't
15:07alyssaAnyway, here's my take:
15:07alyssaRender passes don't map to how AGX works *anyway*
15:08alyssaMetal's rendering model doesn't really map to AGX either, but it's a helluva lot closer
15:08karolherbstis metal really that great/terrible how people say?
15:08alyssakarolherbst: Definitely my favourite graphics API
15:08alyssathe programming model is a paragon of sanity by comparison.
15:09karolherbstcompared to GL or vulkan?
15:09alyssa /* no comment */
15:09alyssaElla[m]: Not sure how much you know about how render targets work on AGX
15:09alyssaI figured out most of the details in August but haven't had time to update Mesa with the knowledge yet.
15:09alyssaFor the benefit of everyone else in the room I'll summarize:
15:10alyssaEverything happens via fragment shaders. Everything!
15:10karolherbstmaybe I should try to use metal once and then I have data and can decide to hate or love it or something
15:10alyssaThere is no tilebuffer. It's just local memory, same as compute shaders!
15:10alyssaHow does that work? Well, there are 3 handy instructions:
15:11karolherbstdoes something like helper invocations even exist?
15:11alyssa1. local pixel store. This works like a local store (as compute kernels use), but the destination is implicitly indexed by the fragment coordinate. It's a formatted load, meaning you specify the format in the instruction and it does conversion (rgba8 -> f32) in hardware for you.
15:12alyssaThe shader passes in a byte offset, a format, and a value to store.
15:12alyssaThis is how fragment shaders write out their results to the "tilebuffer".
15:12alyssa2. local pixel load. The above in reverse. This is how we can load the "tilebuffer" to implement blending.
15:13alyssa3. copy local block to image.
15:13alyssaThis is the most subtle. ("unkB1" in applegpu right now)
15:14alyssaThis takes in an image descriptor (usually loaded into a texture state register with BIND_TEXTURE)
15:14alyssaand a format and a byte offset
15:14alyssaIt interprets a block of local memory according to the format/byte offset provided, and blits it to the right spot in the image you pass in.
15:15alyssaGenerally this instruction is used in the special "end-of-tile" program.
15:15alyssaThat is a fragment-like shader that runs once per tile, rather than once per pixel, after all regular fragment shading is done.
15:16alyssaThe driver prepares this shader based on the API state.
15:16alyssaFor example, to implement N render targets with different formats, the driver will bind N texture state registers with descriptors mapping each render target in memory with the format of the attachment in memory.
15:17alyssawith a shader that contains N block copy instructions, each specifying the format and location of the render target in the tilebuffer
15:18chipxxx has quit [Read error: Connection reset by peer]
15:18alyssa(I expect those formats need not match exactly but they must be compatible for the results to make sense.)
15:19alyssaFor completeness, there's also a special "background" program that runs for every pixel before any other fragment shader. It should load or clear all render targets as necessary.
15:19alyssa(For loads, the driver will again bind N texture state registers with texture descriptors mapping the render target's existing contents)
15:19alyssa---------------
15:19alyssaSo how does any of this map to subpasses?
15:20alyssaIdeally, the "background -> draws -> end of tile" pipeline is a single *render pass*
15:20alyssaThe background program initializes the tilebuffer for the *first* subpass.
15:21alyssaBefore and after each subpass, there is a fixed layout of the tilebuffer: mappings of colour attachments to offsets and tilebuffer formats.
15:21alyssaFragment shaders are keyed to the layout before and after, determining how input attachments are read and colour is written respectively.
15:21alyssaFinally, the end of tile program writes out only what's left at the end with STORE_OPs
15:22alyssa------------
15:22alyssaThis can all be done with render passes, but it doesn't really map in a totally clean way.
15:22alyssaConceptually what we actually want is:
15:22alyssavkBeginRendering(the layout at the END, that will actually be stored to memory)
15:23alyssaDraws where input attachments are lowered to "tilebuffer load" and outputs are lowered to "tilebuffer store", keyed to the explicit tilebuffer layouts
15:23alyssa(what Metal calls "imageblocks")
15:23alyssavkEndRendering()
15:23alyssaSo to implement all this subpass gooiness, we'd want to be doing an internal dynamic rendering for the whole render pass, with some sort of internal VK_MESA_pixel_local_storage extension
15:24alyssa(EXT_pixel_local_storage is a GLES extension adding imageblocks.)
15:25alyssaMy motivated reasoning says that we could extend the render pass emulation in the Vulkan core to do that for tilers (implement with dynamic rendering + imageblocks)
15:25alyssaBoth Mali and AGX want that common lowering
15:26alyssaI assume PowerVR too given the heritage.
15:26alyssaI don't know if v3dv could use.
15:26alyssaI don't think turnip can, because qualcomm isn't a traditional tiler.
15:26alyssaI think it can be done... I don't think I want to be the one to do it ;)
15:33karolherbstI am actually wondering if we'll see more hardware like that even in the discrete space, where stages will be more like that
15:35MatrixTravelerbot[m]1 has quit []
15:47alyssakarolherbst: The conceptual block diagram is the same as Mali, the hardware is just a lot less opinionated.
15:51karolherbstalyssa: sure.. but I could also imagine that nvidia or AMD are more aggressive about killing of stages, but maybe they are simply less concerned about space and keep their stuff. At least for nvidia I know that they already just use L1 or L2 cache for all those stage special memory things
16:45linaI ended up reading the entire ispc saga...
16:45karolherbstit's fun, isn't it?
16:50linaIt is!
16:51linaAlso it seems so obvious in retrospect, shaders for CPUs... why wasn't that a thing before?
16:51karolherbstthough I am not sure myself if I read the full thing, might have stopped somewhere in the middle. The first part is in itself already a good story about intel here :D
16:51linaI read until the leaving intel part
16:52linaThe stories of Intel internal coporate culture explain so much...
16:52karolherbstthe main problem is, that for different problems you have to use different mindeset. Normal code written for C doesn't optimize well, and normal C devs never had to think much about data paralization and all of that
16:52alyssalina: All of the "this GPU is scalar/vector" drama makes a lot more sense when you realize subgroup-style SIMD is equivalent to vec4 SIMD :)
16:52karolherbstif you can use avx/sse all the way, it can be super fast, but normal code doesn't give you that
16:52karolherbstand never will
16:52linaalyssa: Yeah ^^
16:52karolherbstcoporate culture is more important than "technical reasoning" for most things
16:53karolherbstor well.. the more relevant reason why things turned out how they did
16:53linaYup...
16:56karolherbstnot even wanting to say that it's a bad thing, because most of the time "technical points" are just mindsets/culture put into something abstract and ticked of with a "yep, that's how it must be"
16:57karolherbstin the end what works decides what's the best thing, not some abstract reasoning
17:02karolherbstuhhh that "On jerks and institutional acceptance of them" part reminds me of some...
17:12karolherbstI am now actually wondering what would happen if we mixed llvmpipe with ispc...
17:12karolherbstthough llvmpipe is already doing similar things
17:13karolherbstbut also not sure how much it embraces AVX
17:31compassion4 has joined #asahi-gpu
17:36compassion has quit [Ping timeout: 480 seconds]
17:36compassion4 is now known as compassion
18:07alyssallvmpipe already does ispc's 1 Weird Trick
18:08karolherbstyeah .. for most part
18:08karolherbstfunny thing is though, that pocl is roughly 10x as fast as llvmpipe in luxmark
18:10karolherbstbut I am also not super concerned about llvmpipe with CL, because it's easy to just use pocl
18:31goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:32goldsoultheory has joined #asahi-gpu
18:33goldsoultheory has quit []
19:05joske has joined #asahi-gpu
19:06joskesome observations from running Lina's GPU driver on M1 MBA 16GB: doesn't boot reliably, seems I *need* to edit the kernel command line in grub, or it won't boot, and it seems that loglevel must be set to 8
19:08joskeonce booted, wifi doesn't work: complains about some crypto things missing in the kernel while they ARE available: https://paste.debian.net/1255756/
19:09joskewhen running GNOME in wayland, function keys are not working (can not change volume etc), while I'm pretty sure that worked before in GNOME wayland
19:10goldsoultheory has joined #asahi-gpu
19:11joskedesktop does seem to be stable once running
19:16joske has quit [Quit: Leaving]
19:16yuyichao_ has quit [Read error: Connection reset by peer]
19:18joske has joined #asahi-gpu
19:18joskeconfirmed function keys are working in released asahi kernel in GNOME wayland
19:19yuyichao_ has joined #asahi-gpu
19:22joske has quit []
19:58alyssathose sound like kernel misconfiguration or busted initramfs or something
20:01RowanG[m] has quit [Quit: Client limit exceeded: 20000]
20:02joske has joined #asahi-gpu
20:03joskekernel misconfiguration is possible of course (it's an old config I used when I was still using 4k kernel)
20:03joskenot using an initrd
20:03joske has quit []
20:05alyssawhere is the wifi firmware coing from
20:06alyssaalso, modules
20:08joske has joined #asahi-gpu
20:08joskeboth from the rootfs, this was always working without initrd
20:08alyssadid you install up to date modules?
20:09alyssais the local version sane?
20:09joskeyes (make modules_install)
20:09alyssai'm not a kernel dev [dubious - discuss], not sure I can help other than ask questions about stuff I've screwed up in the past :D
20:09karolherbstis it fixed after loading the modules?
20:09joskebrcmfmac was loaded
20:10karolherbstsure, but also the crypto stuff?
20:10joskeand I've built all crypto stuff into kernel (=y)
20:10karolherbstwell... but why does it complain then?
20:10joskeno idea
20:10karolherbstsure all of those symbols are actually there?
20:11karolherbstuhm.. configs
20:11joskehmm how can I check?
20:11karolherbsteither in your .config or the one getting installed to /boot/
20:11joskeI mean the symbols
20:11karolherbstI am sure iwd just checks the config
20:12sveni don’t der how enabling the gpu driver could break any of that tbh. Maybe the debug part due to sone timing but the rest very much sounds like config issues
20:12sven*i don’t see
20:12joskeyes it could very well be I'm messing something up
20:12karolherbstI am not entirely sure _how_ iwd checks it.. maybe you have to make sure to also install the config or something
20:12karolherbstmaybe iwd checks against =m
20:13joskeinitially it was =m
20:13karolherbstthat could be it
20:13joskethen I saw it didn't find it, then I built again as =y
20:13karolherbstnormally the rule is: initramfs or no support
20:13joskebut it was the same
20:14karolherbstand that network stuff is usually built around the fact that you have an initramfs
20:14karolherbstif you leave this assumption you are generally on your own and I advise you to use an initramfs
20:14joskeI was not aware of that rule ;-). And as I said it had always worked without (been using my own kernel with sven's 4k patch for many months)
20:14karolherbstsure.. and something might have changed
20:15alyssato be clear you're not using 4k pages now?
20:15joskeI appreciate any help of course, and I don't want to send you in a wild goose chase
20:15karolherbstmaybe a config of those got disabled by accident or...
20:15svenUsing that patch also means you get to keep the parts of things break! ;)
20:15joskehaha but it never did!
20:15joskeit has worked just long enough until chromium and vscode supported 16k pages
20:16joskethen I re-installed with asahi reference distro and release kernel
20:16karolherbstthe annoying part is that loading order kind of matters... might be simpler to start with a stock config taken from somewhere
20:16joskeyes, I'll do that
20:16alyssaremember kids you always win a race you can ignore it
20:16karolherbstbuild and install from that to make sure it boots and loads network sucessfully
20:17karolherbstand then only make very very very small changes and go another test
20:17joskeI'll use the config of the asahi kernel as base, and do olddefconfig
20:18joskeproblem is the release kernel doesn't boot with the boot.bin with the new device tree
20:18karolherbstright.. but that shouldn't be a problem if you only keep the old config.. probably
20:19joskeyes I can try that
20:24goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:31goldsoultheory has joined #asahi-gpu
20:31jannauwifi/iwd works for me with the gpu driver enabled
20:31joskethat's good to know thx, so please ignore me for now
20:32joskejannau: do the function keys work?
20:32jannauI haven't tested on a m1 macbook
20:33karolherbstI think I am 🤏 so close of getting an M1 apple macbook myself...
20:34joskekarolherbst: you won't regret it, even without the GPU driver, the machine is very usable in linux
20:34svenkarolherbst: you know you want to! You won’t regret it :p
20:34alyssakarolherbst: and I think I am 🤏 so close of getting an M2 macbook :-p
20:35karolherbstI am the kind of person who'd just go with the m2 ultra straight away
20:35joskethat won't be a macbook though :-D
20:35svenwhy not both!
20:36karolherbstjo... I mean.. the ultra is already expensive enough at it is
20:36joskemaybe wait for the M2 extreme!
20:36karolherbstahh it's m1 max actually
20:36karolherbstthose marketing people
20:36alyssaI cannot understand the marketing.
20:36Ella[m]I wrote a script to regularly scrape second hand sites until i could find something I could afford
20:36joskeI have an M1 max MBP for work, I installed asahi on it for a few hours (not allowed in fact), it flies
20:36alyssaI prefer the code names just to get away from the ridiculousness.
20:37karolherbstshould have called it SS M1 SS2 M1....
20:37sventhey listened too much to the usb if
20:37karolherbstis the M2 equal to the M1 for the bits which matter btw?
20:38karolherbstthough I don't think I need the GPU power, because what usually happens is, that once nvidia release new GPUs, I get them anyway
20:38svenit had some new hardware and changed a few things around. Don’t think anyone looked at the gpu in detail yet afaik
20:39karolherbstk.. atm I am looking at the 14-inch one... 16 might be a tad too big.. dunno
20:40svenim still happy with my 13 inch m1 air. Except that it only does a single external screen
20:40svenbut we’ll see if I can „fix“ that
20:40karolherbstis that really a limitation though?
20:40joskejust get the air, in single core perf, it's the same, and NO noise
20:40karolherbstI had an argument on the dri-devel mailing list with somebody who wanted to always use the discrete GPU for external ports (there are laptops where you can one time flip to the discrete one) so they can plug in 4 displays instead of 3.... and I was like:: seriuosly?
20:41karolherbstand make it the default for all laptops with such a flip
20:41joske has quit [Remote host closed the connection]
20:41svenI just want two external screens and not use the internal screen when I’m at home tbh
20:41karolherbstunless apple messed up the hw, it should be possible... hopefully
20:42karolherbstcould also be hardcoded in their firmware
20:42alyssaI'm boring and only use a single monitor
20:42svenyeah, I have an idea how to hack it. They do support two separate DP streams for tiled displays
20:42jannauno, the internal display controller seems to be special
20:42svenand I know how to reroute those to two separate ports
20:42karolherbstI also only use one, but my intel GPU is already busy with two 4k screens... :D
20:42svennow the only questions remaining is if the Display controller firmware will hate me for that
20:42karolherbstit probably will
20:43karolherbstquestion is: does it matter?
20:43karolherbstand is the firmware signed?
20:43svenfair enough :)
20:43svenit’s unfortunately signed, yeah
20:43goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:43jannauthe firmware will most likely crash
20:43karolherbstsooo.. there might be a way to get around signed firmware, which... ehh I know because of reasons
20:43karolherbstnot sure if that would work on apple hardware though
20:44svenmaybe it’ll at least work with two identical displays. We‘ll see
20:44karolherbstit also depends on how they verify the signature
20:44karolherbstand how the secret is stored
20:44karolherbstbut yeah.... it's pointless if one needs to do heavy changes to the firmware
20:44svenThey load the fw and lock down the processor with fancy hw features before we get control
20:44jannaudcp firmware is loaded on boot by the system bootloader
20:45karolherbstnvidia did the same, but people still managed to find a way to leak the signature keys
20:45karolherbsthw isn't perfect
20:45svenWe’d need the iPhone root signature keys afaik :D
20:45karolherbstI suspect apple has a bit more experience with making sure it's secure than nvidia does
20:46svenyeah…
20:46karolherbstnintendo wasn't amused
20:46jannauapple is certainly not perfect, the dcp firmware was used to pown macos
20:47jannauerr, ios
20:47svenoh, I’m sure i could get rop code exec on the DCP in a weekend or so
20:47svenbut that’s nothing we want to rely on
20:48svenI’m only willing to try and abuse their tiled display support
20:49karolherbstyeah... but it's better to make a decision once it's known what the limitations are and if one could simply binary patch something... though even that is very annoying
20:49svenbut binary patching would already require an exploit somewhere
20:49jannautwo (mostly) identical displays is probably too much of an limitation but it should be possible to build a thunderbolt/usb4 dock which emulates a tiles display
20:50svenand I’m specifically working on this hw because I don’t have to write or rely on exploits ;)
20:50svenI’d be very happy with that two mostly identical display limitation fwiw
20:51svenbut let’s ses what happens first
20:51goldsoultheory has joined #asahi-gpu
20:51jannausure, but I could imagine that it a reason why such product doesn't exists
20:52alyssasven: so that's a "no" on iPad M1 bootrom exploits from you? :-p
20:52jannauno matter how large you write that only works with 2 identical displays you will be swamped with support requests
20:52svenyeah, and maybe also why apple doesn’t support that configuration on m1
20:53svenalyssa: yup :p
20:54alyssaMainly I don't understand why they have the DCP architecture at all on anything other than the watches
20:55alyssathe M1 Ultra dies are comically inefficient with the DCPs..
20:55svenwithout DCP we’d have to write fun parts like DP link training ourselves :/
20:56karolherbstwait.. so tiled displays work?
20:56karolherbstany max resolution there?
20:56svenyes, but only if they use thunderbolt and not MST
20:57sven6k I think
20:57karolherbstokay so... tiled displays are just two displays
20:57jannauwe suspect that the m1 ultra supports 6 6k displays instead of just 4 like claimed by apple
20:57karolherbstI mean like literally two displays
20:58karolherbstDP has a flag in the edid to mark them as such, so the OS can properly deal with that
20:58svenyup, which why I hope that I can hack that to support two actually separate displays on two ports
20:59karolherbstyeah... that should be possible.. worst case you just modify the edid the firmware sees.. but dunno how that's all wired up on the hardware
21:01karolherbstso TB usually has twice the amount of bandwith than DP, so requiring TB for 6k might even make sense
21:01karolherbstthere is also this lane assignment business going on
21:01karolherbstand one could argue that you don't want to waste all 4 lanes on Displayport
21:03alyssaif I never again see the word "crossbar" it will be too soon
21:08svenwhat’s so bad about crossbar? :p
21:10karolherbsthow are crossbar related to that anyway?
21:12jannaurouting dp from any DCP to any USB4 ports but no cross die routing on the m1 ultra
21:12jannaubut I think alyssa has something else in mind
21:32alyssajannau: no, that :)
21:33alyssamultiplexers! wow!
21:35* karolherbstshould stop trolling trolls on phoronix
21:36SSJ_GZ has joined #asahi-gpu
21:37SSJGZ has quit [Remote host closed the connection]
21:38alyssakarolherbst: "Go compiles fast because the compiler isn't great at optimizing. "
21:38* alyssagrabs popcorns
21:38karolherbstit gets better
21:39alyssaEh, i think that's the best line :-p
21:39alyssaI really liked Go when I used it
21:39* karolherbstnever used go
21:39alyssaI don't write the sort of software that Go shines at, but I really liked what I saw when I was playing with it
21:40alyssaexcept for the error handling
21:40karolherbstbut seems like go isn't such a controversial topic, so it's easier to engage on those "anti rust" folks
21:40alyssai swear i need a keybinding to insert "if err != nil { return err }"
21:40karolherbstyou mean like "?"?
21:42karolherbstbut I am actually interested about all those fake arguments people pull out just to say why Rust doesn't belong into anything or something
21:42karolherbstmy favourit is still "it shouldn't have a stdlib"
21:43alyssakarolherbst: I wonder what would happen if you claimed serde was part of the stdlib :-p
21:43karolherbstI still have ~3 hours until I have to leave
21:44karolherbstalyssa: I already said that package management is an important key feature of rust :D
21:44alyssaokay but itertools
21:44karolherbstbut sure.. I could say that pulling in serde would be cool
21:44alyssawhy is itertools not stdlib
21:44karolherbstbecause it's still experimental?
21:44alyssaif we're doing the whole functional thing
21:44karolherbstrust does have this formal "get shit into stdlib" process
21:44karolherbstand crates are used to toy around first
21:44karolherbstthere are other things pulled from crates into stdlib all the time
21:45karolherbstnum_integer e.g. has some nice things
21:46dottedmagalyssa: w.r.t. things Go shines at: I'm doing a Wayland compositor in Go for fun (under macOS four double-fun), and it still kinda-shines.
21:46SSJ_GZ has quit [Ping timeout: 480 seconds]
21:46alyssadottedmag: Interesting
21:46dottedmags/four/for/
21:46karolherbstas long as more and more things are getting pulled into stdlib we might not even need crates long term in mesa
21:46karolherbstthough not having serde would be a big downside :(
21:46alyssaI was referring to web services and such
21:47alyssa(or a Gemini service, in my case)
21:48karolherbstit's kind of sad though how those "software purist" always think the entire world is bad and they are the only one who really get it
21:50i509VCBI am kind of on the train of "the standard library is where libraries go to die". You need to be very selective of what goes in.
21:50karolherbstsure and I think the rust community is very very selective on that
21:51alyssakarolherbst: what about those who think the entire world is bad and nobody gets it including them? :P
21:51i509VCBwhy would mesa need to depend on serde specifically? I'm guessing there is some need somewhere to manage json or xml?
21:51karolherbstshader caching
21:52i509VCBso you are looking at putting rust in nir?
21:52karolherbstnah, it's more about metadata
21:52i509VCBI'm not sure where we are so I may sound lost
21:52karolherbstI have a few structs I have to serialize
21:52karolherbstand atm I handroll the code
21:52karolherbstbut come on.. why do I have to hand roll serializeing enums and stuff
21:53i509VCBderive in serde does work, but it can be a little too heavy in some use cases
21:53karolherbstyeah.. but I only need it for trivial enough things
21:54karolherbstit's not a biggy, but that's one place where e.g. using serde would make sense
21:54karolherbsteven though it's doing much more than we actually need
21:54karolherbstdon't even need a special format.. a plain binary dump is enough
21:55karolherbstmaybe serde is actually too big for that
21:55i509VCBserde is also a little awkward to deal with when regarding binary formats
21:56karolherbstyeah... though we have a little trick: shader caches are only valid for the same mesa binary
21:56i509VCBbincode v2 moved away from serde (but still supports it) because it's a binary format
21:56karolherbstif you got a new version, the cache is invalid
21:56alyssaI used a neat library for this recently
21:56karolherbstso what I really need is just an easy way to map between data types and [u8]
21:56alyssawell, 9 months ago 'recently'
21:57alyssaI think that's only the parsing half of things
21:58karolherbstmostly that enum to int mapping is annoying, though I could just unsafe it I think?
22:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
22:00yrlf has joined #asahi-gpu
22:04i509VCBI'd think TryFrom implementation that returns an Err given an invalid value would make more sense
22:06i509VCBThat way you can just do self.enum_value as u32
22:06i509VCB(repr(C) is an example, could be repr(u32) or whatever_
22:06karolherbstwell.. returning an Error doesn't help with anything though
22:06karolherbstbecause the fallback is to just compile the source regardless
22:07karolherbstbut yeah.. maybe repr(C) would help
22:07alyssaunsafe { transmute } all the things
22:07* alyssais not very good at Rust
22:07karolherbstalready having enough unsafe blocks :D
22:08i509VCBOr `impl From<u32> for Option<TheEnum>` could be another option
22:08karolherbstthough I am sure that the 1st place of unsafe \ loc goes to the stdlib
22:08karolherbsti509VCB: my point was more, that I don't want to have to write the code for it :)
22:08alyssamako template generating rust code? :-p
22:08karolherbstbecause when it gets changed, the code needs got get updated
22:09karolherbstI think there are also crates making that int <-> enum conversion less painful
22:10karolherbstbut then I also want to just declare a type to get derived serialize/deserialize methods
22:11M152ari[m] has joined #asahi-gpu
22:11i509VCBsure I get don't want more ticking timebombs that explode when you forget to update little things.
22:11i509VCBan int <-> enum derive macro sounds interesting
22:12i509VCBlooks abandoned sadly
22:13karolherbstor it's the first crate to be "done"
22:13i509VCBWell the open pull request is my metric of that
22:13i509VCBThe author seems to exist still, I guess it could be brought back up
22:14karolherbstor maybe it's part of serde now
22:14karolherbstit does seem to use serde It hink...
22:14karolherbstbut not sure if serde supports that out of the box now
22:15karolherbstbut looking at bindgen I think rust really needs to improve handling of "int enums", to make interacting with C code less painfull
22:16i509VCBIsn't there an option to generate rust enums in bindgen?
22:16alyssakarolherbst: especially bit enums
22:17karolherbsti509VCB: yeah, and then 4 other enum types
22:17karolherbstall those enum types have pro and cons
22:17karolherbstI think I use all of them in mesa...
22:17i509VCBYou can mark it as a bitfield enum, but you have to name all the types... https://docs.rs/bindgen/0.60.1/bindgen/struct.Builder.html#method.bitfield_enum
22:18karolherbststill.. they are annoying to use
22:18karolherbstcould be worse though
22:33goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:42bluetail4 has joined #asahi-gpu
22:42bluetail has quit [Ping timeout: 480 seconds]
22:42bluetail4 is now known as bluetail
23:16laintree has quit [Remote host closed the connection]
23:20lain has joined #asahi-gpu
23:56juleeandres[m] has joined #asahi-gpu
…