marcan changed the topic of #asahi-gpu to: Asahi Linux: porting Linux to Apple Silicon macs | GPU / 3D graphics stack black-box RE and development (NO binary reversing) | Keep things on topic | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-gpu
rockinrobstar[m] has joined #asahi-gpu
rockinrobstar[m] has joined #asahi-gpu
JusticeEX has quit [Ping timeout: 246 seconds]
JusticeEX has quit [Ping timeout: 246 seconds]
yrlf has quit [Quit: Ping timeout (120 seconds)]
yrlf has quit [Quit: Ping timeout (120 seconds)]
<DarkShadow44> bloom: How exactly snooping GPU memory? Is that what comes out from wrap.c:dump_mappings?
<DarkShadow44> bloom: How exactly snooping GPU memory? Is that what comes out from wrap.c:dump_mappings?
yrlf has joined #asahi-gpu
yrlf has joined #asahi-gpu
<dougall> (to be clear you want g13 instructions, rather than llvm ir, right?)
<dougall> (to be clear you want g13 instructions, rather than llvm ir, right?)
<DarkShadow44> yes, for analysing the ISA
<DarkShadow44> yes, for analysing the ISA
<dougall> i find this branch the easiest way to build and get G13 code from a metallib: https://github.com/Thog/gpu/tree/metallib (you can modify macho_disasm.c to write the code to a file instead of calling agx_disassemble... but metallib code does compile a bit differently to non-library code, so something like dump_mappings is preferable for that)
<dougall> i find this branch the easiest way to build and get G13 code from a metallib: https://github.com/Thog/gpu/tree/metallib (you can modify macho_disasm.c to write the code to a file instead of calling agx_disassemble... but metallib code does compile a bit differently to non-library code, so something like dump_mappings is preferable for that)
<dougall> (e.g. it'll never use the discard hint, as it can't assume all threads are active when the library function is called)
<dougall> (e.g. it'll never use the discard hint, as it can't assume all threads are active when the library function is called)
<DarkShadow44> ah thanks. so, to be clear, dump_mappings does indeed dump G13 code as well?
<DarkShadow44> ah thanks. so, to be clear, dump_mappings does indeed dump G13 code as well?
linuxgemini has quit [Read error: Connection reset by peer]
linuxgemini has quit [Read error: Connection reset by peer]
<dougall> i'm like 90% sure - yeah - the tricky bit is it'll dump code for about six other different shaders and you have to find the code you care aboout at some offset in one of the dumped mappings...
<dougall> i'm like 90% sure - yeah - the tricky bit is it'll dump code for about six other different shaders and you have to find the code you care aboout at some offset in one of the dumped mappings...
<DarkShadow44> oh I see...
<DarkShadow44> oh I see...
<DarkShadow44> about the caching bit, I only knew about metallib shader files
<DarkShadow44> about the caching bit, I only knew about metallib shader files
<DarkShadow44> are shaders usually uploaded to the driver as source code? Or why is there a generation difference?
<DarkShadow44> are shaders usually uploaded to the driver as source code? Or why is there a generation difference?
<DarkShadow44> not quite sure how the caching/threads work yet
<DarkShadow44> not quite sure how the caching/threads work yet
<dougall> (i got it working with an old revision of asahilinux/gpu and never updated - iirc one of these hardcoded offsets worked for me https://github.com/AsahiLinux/gpu/blob/b9591908e19a737aaa60c28619fbd39a091ce0f1/wrap/wrap.c#L143 )
<dougall> (i got it working with an old revision of asahilinux/gpu and never updated - iirc one of these hardcoded offsets worked for me https://github.com/AsahiLinux/gpu/blob/b9591908e19a737aaa60c28619fbd39a091ce0f1/wrap/wrap.c#L143 )
<dougall> and yeah, no idea - i don't really know how metal works, sorry
<dougall> and yeah, no idea - i don't really know how metal works, sorry
<dougall> (or, if I'm understanding correctly, I think they're usually given to the driver as LLVM IR? which it specialises because it knows "this is a top level compute or whatever function"? but that's mainly based on having used those two tools on the same functions and seen the code differences, so I'm not sure)
<dougall> (or, if I'm understanding correctly, I think they're usually given to the driver as LLVM IR? which it specialises because it knows "this is a top level compute or whatever function"? but that's mainly based on having used those two tools on the same functions and seen the code differences, so I'm not sure)
JusticeEX has joined #asahi-gpu
JusticeEX has joined #asahi-gpu
<DarkShadow44> hm, according to what I found, metallib seems to be LLVM IR code
<DarkShadow44> hm, according to what I found, metallib seems to be LLVM IR code
<DarkShadow44> they are definitely not macho, the magic is different
<DarkShadow44> they are definitely not macho, the magic is different
<DarkShadow44> my I ask how you got your shader mdougall: acho?
<DarkShadow44> my I ask how you got your shader mdougall: acho?
<DarkShadow44> dougal: may I ask how you gor your shader-macho file?
<DarkShadow44> dougal: may I ask how you gor your shader-macho file?
<dougall> ah, yeah (heh, neither of those pings worked) - I use https://github.com/Thog/gpu/blob/metallib/metal_compiler.m which calls [MTLDynamicLibrary serializeToURL:...] to generate it
<dougall> ah, yeah (heh, neither of those pings worked) - I use https://github.com/Thog/gpu/blob/metallib/metal_compiler.m which calls [MTLDynamicLibrary serializeToURL:...] to generate it
<dougall> (command to compile it is in a comment at the top of that file - sorry if that's pointing out the obvious, but i missed it myself)
<dougall> (command to compile it is in a comment at the top of that file - sorry if that's pointing out the obvious, but i missed it myself)
<DarkShadow44> ah thanks, I kinda missed that
<DarkShadow44> ah thanks, I kinda missed that
<DarkShadow44> probably won't need the compiler snipped, since I'm using XCode
<DarkShadow44> probably won't need the compiler snipped, since I'm using XCode
omoiti has joined #asahi-gpu
omoiti has joined #asahi-gpu
odmir has quit [Remote host closed the connection]
odmir has quit [Remote host closed the connection]
really3 has quit [Remote host closed the connection]
really3 has quit [Remote host closed the connection]
phiologe has quit [Ping timeout: 240 seconds]
phiologe has quit [Ping timeout: 240 seconds]
phiologe has joined #asahi-gpu
phiologe has joined #asahi-gpu
omoiti has quit [Ping timeout: 265 seconds]
omoiti has quit [Ping timeout: 265 seconds]
<DarkShadow44> dougall: Is there a specific instruction where I could help fill in the gaps? As a beginner, and so.
<DarkShadow44> dougall: Is there a specific instruction where I could help fill in the gaps? As a beginner, and so.
akemin_dayo has quit [Ping timeout: 245 seconds]
akemin_dayo has quit [Ping timeout: 245 seconds]
<dougall> hmm, not that springs to mind... maybe the instructions that implement fast sin/cos, or simd-group ops like 'call/ret' and 'simd_shuffle_down'
<dougall> hmm, not that springs to mind... maybe the instructions that implement fast sin/cos, or simd-group ops like 'call/ret' and 'simd_shuffle_down'
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #asahi-gpu
_whitelogger_ has joined #asahi-gpu
_whitelogger_ has quit [Remote host closed the connection]
akemin_dayo has joined #asahi-gpu
_whitelogger_ has joined #asahi-gpu
_whitelogger_ has joined #asahi-gpu
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #asahi-gpu
_whitelogger_ has joined #asahi-gpu
mjg59_ is now known as mjg59
mjg59_ is now known as mjg59
crabbedhaloablut has quit [Ping timeout: 240 seconds]
crabbedhaloablut has quit [Ping timeout: 240 seconds]
crabbedhaloablut has joined #asahi-gpu
crabbedhaloablut has joined #asahi-gpu
akemin_dayo has quit [Ping timeout: 256 seconds]
akemin_dayo has quit [Ping timeout: 256 seconds]
akemin_dayo has joined #asahi-gpu
akemin_dayo has joined #asahi-gpu
<bloom> dougall: not that I'm discouraging more r/e, but fast sin/cos is surprisingly uninteresting on GPUs
<bloom> dougall: not that I'm discouraging more r/e, but fast sin/cos is surprisingly uninteresting on GPUs
<bloom> (nowadays)
<bloom> (nowadays)
<bloom> asin/acos/atan even more so
<bloom> asin/acos/atan even more so
<bloom> Mesa doesn't even ave asin/acos/atan acceleration wired up, it's lowered to a (iirc polynomial..?) approximation unconditionally :-P
<bloom> Mesa doesn't even ave asin/acos/atan acceleration wired up, it's lowered to a (iirc polynomial..?) approximation unconditionally :-P
<dougall> heh - yeah, iirc they just use a couple of (hopefully) uninteresting instructions i haven't named yet, so it might be a good beginner instruction to re
<dougall> heh - yeah, iirc they just use a couple of (hopefully) uninteresting instructions i haven't named yet, so it might be a good beginner instruction to re
linuxgemini has joined #asahi-gpu
linuxgemini has joined #asahi-gpu
linuxgemini has quit [Read error: Connection reset by peer]
linuxgemini has quit [Read error: Connection reset by peer]
linuxgemini has joined #asahi-gpu
linuxgemini has joined #asahi-gpu
odmir has joined #asahi-gpu
odmir has joined #asahi-gpu
omoiti has joined #asahi-gpu
omoiti has joined #asahi-gpu
omoiti has quit [Read error: Connection reset by peer]
omoiti has quit [Read error: Connection reset by peer]
omoiti has joined #asahi-gpu
omoiti has joined #asahi-gpu
linuxgemini has quit [Read error: Connection reset by peer]
linuxgemini has quit [Read error: Connection reset by peer]
linuxgemini has joined #asahi-gpu
linuxgemini has joined #asahi-gpu
richbridger has joined #asahi-gpu
richbridger has joined #asahi-gpu
aquijoule__ has quit [Ping timeout: 265 seconds]
aquijoule__ has quit [Ping timeout: 265 seconds]
<DarkShadow44> dougall: Do you already have documentation prepared to device_store/device_load?
<DarkShadow44> dougall: Do you already have documentation prepared to device_store/device_load?
<DarkShadow44> Because for simplicity reason, I need those first to start with proper testing
<DarkShadow44> Because for simplicity reason, I need those first to start with proper testing
<DarkShadow44> if you don't have anything, maybe I could write something up?
<DarkShadow44> if you don't have anything, maybe I could write something up?
<DarkShadow44> on your github it's still maked TODO(), that's why I ask
<DarkShadow44> on your github it's still maked TODO(), that's why I ask
linuxgemini has quit [Write error: Connection reset by peer]
linuxgemini has quit [Write error: Connection reset by peer]
omoiti has quit [Ping timeout: 256 seconds]
omoiti has quit [Ping timeout: 256 seconds]
linuxgemini has joined #asahi-gpu
linuxgemini has joined #asahi-gpu
linuxgemini has quit [Remote host closed the connection]
linuxgemini has quit [Remote host closed the connection]
linuxgemini has joined #asahi-gpu
linuxgemini has joined #asahi-gpu
JusticeEX has quit [Ping timeout: 246 seconds]
JusticeEX has quit [Ping timeout: 246 seconds]
TheJollyRoger has quit [Ping timeout: 268 seconds]
TheJollyRoger has quit [Ping timeout: 268 seconds]
TheJollyRoger has joined #asahi-gpu
TheJollyRoger has joined #asahi-gpu
yrlf has quit [Quit: The Lounge - https://thelounge.chat]
yrlf has quit [Quit: The Lounge - https://thelounge.chat]
yrlf has joined #asahi-gpu
yrlf has joined #asahi-gpu
JusticeEX has joined #asahi-gpu
JusticeEX has joined #asahi-gpu