#
…

2023-08-16

00:54i509vcbshould I be getting stuff oom killed running dEQP-VK.memory.*?
00:58i509vcbnarrator: in a moment of stupidity i5 realizes his swapfile isn't even setup
01:03possiblemeatball has joined #asahi-gpu
01:05cr1901"It was at this moment i5 knew he fucked up"
01:07i509vcbnever mind the missing swapfile
01:07i509vcbI think I fucked up a lot harder
01:09i509vcbI *might* have accidentally ran mkfs.swap on RecoveryOSContainer
01:09i509vcbBut did not enable the swapfile yet
01:13* i509vcbpulls out 2nd laptop
01:15marvin24_ has joined #asahi-gpu
01:20marvin24 has quit [Ping timeout: 480 seconds]
01:23i509vcbnothing of value will be lost at least
01:40dylanchapell has quit [Read error: Connection reset by peer]
01:51tertu2 has joined #asahi-gpu
01:54dylanchapell has joined #asahi-gpu
01:57tertu has quit [Ping timeout: 480 seconds]
02:08ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:08Dementor has quit [Quit: Ping timeout (120 seconds)]
02:21ourdumbfuture has joined #asahi-gpu
02:45ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:47Z750 has quit [Quit: Ping timeout (120 seconds)]
02:47Z750 has joined #asahi-gpu
02:57jeisom has quit [Quit: Leaving]
02:59jeisom has joined #asahi-gpu
03:07jeisom has quit [Ping timeout: 480 seconds]
03:22marvin24 has joined #asahi-gpu
03:30marvin24_ has quit [Ping timeout: 480 seconds]
04:13crabbedhaloablut has joined #asahi-gpu
04:29dylanchapell has quit [Read error: Connection reset by peer]
04:43dylanchapell has joined #asahi-gpu
04:50possiblemeatball has quit [Quit: Quit]
06:48pjakobsson has joined #asahi-gpu
06:49crabbedhaloablut has quit []
06:52WindowPa- has joined #asahi-gpu
06:56mairacanal has quit [Remote host closed the connection]
06:56WindowPain has quit [Ping timeout: 480 seconds]
06:56LinuxM1 has joined #asahi-gpu
07:05WindowPa- has quit [Quit: ZNC 1.8.2 - https://znc.in]
07:05WindowPain has joined #asahi-gpu
07:19bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
07:35iyes has joined #asahi-gpu
07:36LinuxM1 has quit [Quit: Leaving]
07:46iyesHello. :) I'd like to try to contribute. I have a decent understanding of graphics APIs (from a user POV, not an implementer POV), hardware (though more CPUs than GPUs), and I am good at Rust and C (though my C is ... rusty ;) ). Never worked on a gpu driver before.
07:48iyesI have an Asahi (the ALARM based, not Fedora based) install on a M1 Pro MBP, which I don't daily drive but occasionally dual boot into. I don't mind trashing / littering over that OS install. Any advice for how I should set up my workflow for mesa dev?
07:50iyesHow does one iterate on a gpu driver? How can I easily test changes? Also, where can I find documentation?
07:55cr1901 has quit [Quit: Leaving]
07:56iyes has quit [Quit: This computer has gone to sleep]
07:56Method_ has joined #asahi-gpu
08:00Method has quit [Ping timeout: 480 seconds]
08:01cr1901 has joined #asahi-gpu
08:03iyes has joined #asahi-gpu
08:04chadmed has quit [Ping timeout: 480 seconds]
08:29iyesAlso, out of curiosity, has the needed RE work to support cubemap array textures been done? Or is that still blocked on unknowns about the hardware?
08:33jannauiyes: fast iterating on the rust kernel driver works with a development + test machine using m1n1's lightweight hypervisor
08:34jannauthe mesa driver OpenGL and vulkan drivers (C) can be tested on the development system
08:35jannau`meson devenv` sets the environment up to test drivers from the dev tree
08:37jannauI think a good starting task atm might be fixing easy failing test cases from the vulkan cts in https://gitlab.freedesktop.org/asahi/mesa/-/tree/agxv/main
08:38iyesYea I think I'd rather try my hand at mesa userspace stuff, even though it is in C, because of the simpler dev workflow.
08:38iyesOh so the dev efforts are currently focused on Vulkan and not GL?
08:39jannaualyssa might have other start task
08:41jannaufoccus is slowly shifting but I think the main missing features for opengl (es) are not good first task
08:42iyesYea ofc, for someone unfamiliar with the codebase, need easier things to get into the flow of things. :)
08:43iyesBut speaking of which, (very naive question) how much work does it generally take to implement a GL extension, assuming the needed knowledge of the hardware is available / you aren't blocked on not understanding the hardware?
08:43iyes I mean, ofc it varies, some are very complex ... but let's say it is some smaller GL extension, not something huge like geometry shaders
08:44cylm_ has joined #asahi-gpu
08:44iyesI remember alyssa said that the Asahi project started out with GL and not Vulkan, because the existing frameworks/infra in mesa made it easy to implement GL, as it takes care of the peculiarities of the API and the hardware agnostic stuff
08:44mcint has quit [Quit: WeeChat 3.0]
08:45jannaudocumentation is in https://github.com/dougallj/applegpu, makes sense to (re-)read Alyssa's blog post on agx
08:47iyesAwesome, will read it
08:47iyesAnd what about general mesa developer documentation?
08:47jannauanother reason for starting with opengl was that it clearly would have a driver which can be used
08:53iyesWhere can I find general (non-asahi-specific) docs to help me learn and navigate around mesa's codebase, architecture, apis, dev workflows, etc?
08:54_jannau__I don't know. you could ask in #dri-devel
08:55iyesOkay thanks!
09:06linaalyssa: Good news! I figured out what the helper program is for.
09:06linaBad news: It's actually setting up the stacks, so we get to implement all that if we want spilling ^^;;
09:06linaThat suddenly makes a lot of sense though...
09:09iyes has quit [Quit: This computer has gone to sleep]
09:20zane has joined #asahi-gpu
09:26iyes has joined #asahi-gpu
09:38Whistler_ has quit []
09:57chadmed has joined #asahi-gpu
10:09bisko has joined #asahi-gpu
10:22chadmed has quit [Ping timeout: 480 seconds]
11:16Stary has quit [Quit: ZNC - http://znc.in]
11:17Stary has joined #asahi-gpu
11:48ourdumbfuture has joined #asahi-gpu
11:55chadmed has joined #asahi-gpu
12:08ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
12:17iyes has quit [Ping timeout: 480 seconds]
12:18alyssalina: ughhhhh :(
12:18alyssaI thought the helper program was only for compute though, what sets up the stacks for graphics?
12:22iyes has joined #asahi-gpu
12:24linaalyssa: The helper program. It's for all three.
12:24alyssaOh, interesting
12:24alyssahow did we never notice it before?
12:25linaI did see it when bringing up G14X but I didn't make the connection that it was the same helper as always...
12:25linaKernel update in the usual branch, agx/uapi-updates-202308 on top of your layered branch but it's just one commit you can cherry-pick
12:25linaLayered rendering is fixed, needed a kernel bugfix (missing one magic buffer) + all the strides in the UAPI for Z/S
12:26linaAll the helper programs are exposed in the UAPI now too, you just need to implement it ^^
12:26linaAlso threw in the bindless sampler thing
12:26linaAnd some mystery "no preemption" (maybe?) flag that would be nice to test
12:26linaSeemed related to the helper program for compute but unclear
12:27linaI also looked at mesh shaders, it's what you said - no magic CDM in VDM thing, just discrete compute...
12:27linaThere is indeed a magic VA range for dynamic allocation and the messages you'd expect back&forth plus some management structures I didn't look at yet
12:28linaAnd I also figured out stream call/return, I can push some decoder stuff for that, since they use that.
12:28linaApparently the VDM barrier command is also return??
12:28alyssa12:28 lina | And I also figured out stream call/return, I can push some decoder stuff for that, since they use that.
12:28alyssa12:28 lina | Apparently the VDM barrier command is also return??
12:29alyssaIt's a VDM catch-all command
12:29alyssaIf you don't set any bits, it's a VDM nop :~)
12:30iyes has quit [Ping timeout: 480 seconds]
12:37Whistler_ has joined #asahi-gpu
12:41linaalyssa: MR for the decoder stuff opened, I'll let you figure out when we merge the UAPI stuff but we might want to do it soonish? If you can validate the bindless sampler stuff, layered rendering is tested and the helper program thing is pretty obvious.
12:42linaFor the helper program, if you can help get the mystery instructions into the backend I can try to implement the logic (I'm leaving all the buffers up to userspace, unlike macOS, so we can use our own structures/layouts, we don't have to copy theirs)
12:43linaI already took a good look at how that works so at this point I think I only need the magic instructions/SRs to make it do something useful
12:43alyssawhat's the big picture of how that program is supposed to work?
12:45linaMy guess given what we saw now is that it maps 1-4 blocks of stack space, each of which is encoded in a particular way (size/addr compressed together). It receives a structure that is basically an array of those pointers for each threadgroup(?) for each core that can be active at the same time, and indexes into it. There's also a core mapping table, since presumably the core IDs the shaders get are "raw"
12:45linabut not all cores exist in all GPUs so you want to remap to avoid wasting table space.
12:46lina(We already have the core table in the UAPI so the driver has what it needs to do that)
12:46alyssaInteresting... ok
12:46alyssaBizarre mechanism
12:46alyssaSo many simpler ways they could've done this, lol
12:47linaTBH, the core mapping thing is overkill... The table is already a table of pointers to stack blocks, so a dummy core is just 16 bytes * max_active_threadgroups which isn't thaat much wasted space.
12:48alyssaI wonder how this works in vertex shaders
12:48alyssawhere there's no natural "threadgroup"
12:48alyssa(unlike both compute and fragment)
13:07iyes has joined #asahi-gpu
13:07linaalyssa: In my single test it was 61 per core for vertex, and for compute that was capped at some max based on local memory utilization etc, so it's probably just "the max occupancy" for vertex.
13:10iyesHi alyssa ! Re: my earlier messages, do you have anything to add to what jannau said earlier? About places I could start, to get into contributing to mesa/asahi?
13:11karolherbst has quit [Quit: Konversation terminated!]
13:12karolherbst has joined #asahi-gpu
13:12alyssaiyes: this is slightly out-of-date (I don't lead panfrost anymore), but https://rosenzweig.io/AlyssasDriverSurvivalGuide.txt
13:13alyssaum hold on a lot of this is out of datre
13:13alyssadon't read yet let me update
13:21alyssashould get you started :)
13:21iyesAwesome! <3
13:23iyesToday I mostly wanted to gather a reading list for myself. For now, I'll be getting through the stuff I was linked, and doing some exploring. I don't know when I'll actually have the time to dive into code more seriously. When I am actually ready to work on something, I'll let you all know. :)
13:24lina 128: e2023004 mov_imm r0h.cache, 1072
13:24linaAny chance that is disassembled wrong?
13:25alyssaalmost certainly not
13:25linaThat imm doesn't make sense to me... (looking at the helper)
13:27alyssait's decimal, fwiw
13:32mairacanal has joined #asahi-gpu
13:42alyssaDoes this help?
14:00possiblemeatball has joined #asahi-gpu
14:03alyssanow i have to remember how to build a kernel again
14:06alyssanew rust who dis
14:10_jannau__stay away from rust-1.71. if you're compiling with clang/llvm, make sure that it uses the same libllvm as bindgen
14:13ourdumbfuture has joined #asahi-gpu
14:31possiblemeatball has quit [Quit: Quit]
14:37alyssald.bfd: Unexpected GOT/PLT entries detected!
14:37alyssald.bfd: Unexpected run-time procedure linkages detected!
14:37alyssald.bfd: sound/soc/codecs/cs35l45.o: in function `cs35l45_probe':
14:37alyssacs35l45.c:(.text+0x64c): undefined reference to `devm_regmap_add_irq_chip'
14:40alyssallvm-objcopy: error: Link field value 25 in section .rela.dyn is not a symbol table
14:40alyssaI said LLVM=0 :V
14:46Whistler_ has quit []
14:49zane has quit [Quit: WeeChat 4.0.3]
14:59bcrumb has joined #asahi-gpu
15:04bcrumb has quit []
15:06jeisom has joined #asahi-gpu
15:13karolherbst has quit [Quit: Konversation terminated!]
15:14i509vcbalyssa: I looked at other drivers and now I realize I need to lay out a case why every driver except for nvk and radv is implementing vkGetMemoryFdPropertiesKHR wrong
15:15alyssai509vcb: Woo!
15:22iyes has quit [Ping timeout: 480 seconds]
15:28alyssaella-0: i509vcb: Lina has bumped the UAPI for some important new stuff.. let me know when I should do the AGXV rebase
15:28alyssa(which will require you to bump your kernel at the same time)
15:30iyes has joined #asahi-gpu
15:32alyssaAre you running asahi distro kernels, or building your own?
15:32alyssa(If the former, I suppose I can rebase AGXV exactly when we release the new kernel)
15:32i509vcbI'm running the asahi distro kernels, my stuff is mainly in memory land so feel free to bump if ella is okay with it
15:33i509vcbwell assuming memory didn't just to carpet bombed
15:33i509vcb /s/to/get
15:35_jannau__you won't be able to use the rebased agxv with the current kernel
15:37i509vcberr yeah agxv rebase with new kernel release
15:37i509vcbSometimes I don't read enough if the last message
15:37alyssaok, that's fine
15:37as400 has quit [Ping timeout: 480 seconds]
15:38i509vcbBefore I go over to #dri-devel to try to figure out which implementations are wrong, I'll try to explain what I think is wrong with v3dv and co in that function
15:38alyssaI'll bump asahi/main today, and if all goes well, we'll push out the new kernel to arch/fedora users tomorrow(?) and then once the new kernel is pushed out I'll rebase AGXV
15:38iyes has quit [Ping timeout: 480 seconds]
15:39i509vcbSo vkGetMemoryFdPropertiesKHR is used primarily used for determining the memory type of a dmabuf you are importing.
15:39as400 has joined #asahi-gpu
15:40i509vcbhowever a lot of implementations (v3dv, tu, pvr, anv, hasvk) return VK_SUCCESS regardless of the file descriptor you pass into that function
15:40i509vcbYou could pass -1 (invalid fd) and it technically is ok with that function
15:40i509vcbAlso this means you can do something like
15:41i509vcbfd = open("~/Pictures/ferris.txt")
15:41i509vcbvkGetMemoryFdPropertiesKHR(device, fd)
15:41i509vcbwhich seems bizzare since those cannot be prime fds which are what vulkan drivers typically consume with the dma buf handle type
15:42i509vcbthat little pseudocode snippet should be returning VK_ERROR_INVALID_EXTERNAL_HANDLE since a file is definitely not a prime fd
15:42i509vcbradv and nvk will return an error correctly
15:42i509vcbHowever here's the kicker
15:42as400 has quit [Remote host closed the connection]
15:42i509vcbThe spec doesn't actually explicitly allow or forbid this
15:42i509vcbSo the question is, which is right
15:43i509vcb(radv and nvk act correctly here since a prime fd could be from one of a few memory types and the memory type bits need to be set accordingly)
15:46as400 has joined #asahi-gpu
15:47iyes has joined #asahi-gpu
15:47possiblemeatball has joined #asahi-gpu
15:51karolherbst has joined #asahi-gpu
15:55iyes has quit [Ping timeout: 480 seconds]
16:03iyes has joined #asahi-gpu
16:11iyes has quit [Ping timeout: 480 seconds]
16:17i509vcbseems like what v3dv is doing is fine given that the spec seems to says it's undefined behavior to pass an invalid fd
16:20iyes has joined #asahi-gpu
16:28iyes has quit [Ping timeout: 480 seconds]
16:38iyes has joined #asahi-gpu
16:46iyes has quit [Ping timeout: 480 seconds]
16:54iyes has joined #asahi-gpu
17:02iyes has quit [Ping timeout: 480 seconds]
17:11iyes has joined #asahi-gpu
17:19iyes has quit [Ping timeout: 480 seconds]
17:36ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:43ourdumbfuture has joined #asahi-gpu
18:19ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:30ourdumbfuture has joined #asahi-gpu
18:33possiblemeatball has quit [Quit: Quit]
18:34possiblemeatball has joined #asahi-gpu
18:36jeisom has quit [Quit: Leaving]
18:37jeisom has joined #asahi-gpu
18:57lena6 has joined #asahi-gpu
19:51karolherbst_ has joined #asahi-gpu
19:56karolherbst has quit [Ping timeout: 480 seconds]
20:12c10l has quit [Quit: Bye o/]
20:20c10l has joined #asahi-gpu
20:25karolherbst_ has quit [Remote host closed the connection]
20:26karolherbst has joined #asahi-gpu
20:58i509vcbthe fun of dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic, have to effectively rewrite agxv_physical_device_try_create to make the solution bearable
21:00zalyx0 has quit [Quit: later alligator]
21:02zalyx0 has joined #asahi-gpu
21:03ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:14cylm_ has quit [Ping timeout: 480 seconds]
21:27karolherbst has quit [Remote host closed the connection]
21:31karolherbst has joined #asahi-gpu
21:39ourdumbfuture has joined #asahi-gpu
21:50ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:58ourdumbfuture has joined #asahi-gpu
22:00stipa is now known as Guest9096
22:00stipa has joined #asahi-gpu
22:05Guest9096 has quit [Ping timeout: 480 seconds]
22:07ella-0alyssa: I'm running my own kernels but go ahead and rebase
22:07alyssaella-0: ack
22:34ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
22:37ourdumbfuture has joined #asahi-gpu
23:07possiblemeatball has quit [Quit: Quit]
23:09i509vcbagxv_physical_device_try_create really makes me yearn for Rust's Result
23:37ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:44ourdumbfuture has joined #asahi-gpu
…