#
…

2021-05-10

00:17pthariensflame has joined #asahi-gpu
00:19pthariensflame has quit [Client Quit]
02:38PhilippvK has joined #asahi-gpu
02:41phiologe has quit [Ping timeout: 246 seconds]
03:11bloomagx_update_shader(struct agx_context *ctx, struct agx_compiled_shader **out, enum pipe_shader_type stage, struct asahi_shader_key *key)
03:12bloom struct hash_entry *he = _mesa_hash_table_search(so->variants, &key);
03:12bloomLet's play spot the bug 🤦‍♀️
06:55tomtastic has quit [Ping timeout: 246 seconds]
06:57tomtastic has joined #asahi-gpu
08:40jn__using the address of the parameter key, rather than its pointer value
09:52azonenberg has joined #asahi-gpu
09:52azonenbergWondering what the status of OpenGL is. Specifically how plausible it is to get GL_ARB_compute_shader in mesa working on the M1 GPU
09:52azonenbergNot an immediate priority but i have a friend getting a M1 mac who is interested in using glscopeclient on it
09:53azonenbergright now that's not possible
09:53marcancc bloom (I think she's asleep though)
09:53marcanbut my uneducated guess is that computer shaders are *easier* than 3D
09:54azonenbergthe glscopeclient renderer is basically a software rasterizer in compute shaders that takes advantage of the specialized characteristics of waveform data
09:54azonenbergnamely that points are sorted in strict left to right order and in many cases at regular intervals (I have optimizations i can ifdef for that to build two different versions of the shader)
09:55azonenbergThe output is a monochrome fp32 texture that i then splat onto a full-viewport pair of triangles and use a fragment shader to tone map to colors
09:56segher has joined #asahi-gpu
09:56monochroma has joined #asahi-gpu
09:57marcanremember this gpu is TBDR; I wonder if that affects your optimizations
09:58azonenbergThe glscopeclient renderer displays a total of three fullscreen "quads" of two triangles per render pass
09:58azonenbergall with a single texture and very simple shader
09:58azonenbergFirst one is Cairo for the grid, background gradient, etc
09:58azonenbergsecond is the compute shader generated waveform
09:59azonenbergthird is Cairo again for axis labels, protocol decode annotations, and cursors
09:59azonenbergThe waveform rendering itself is basically
09:59azonenbergspawn one compute thread for each pixel along the x axis
09:59azonenbergwithin each thread: loop over all samples whose timestamp is in that pixel
10:00azonenbergfind min/max Y value, interpolating if the segment from that sample to the previous/next crosses outside the pixel
10:00azonenbergfor y=min to max waveform[x][y] += alpha
10:00azonenbergi integrate in shared memory using a couple of threads, then splat out to global memory at the very end since that's slow
10:01marcandoes it do sinc interpolation? :>
10:04azonenbergNot in the shader. there's a sinc filter you can apply to a waveform with arbitrary upsample rate if you want it
10:04azonenbergand then render the upsampled waveform with the shader
10:05azonenbergbut it's just another DSP block you can put in the pipeline
10:05azonenbergglscopeclient works a lot like gnuradio or VTK/ITK
10:05azonenbergsignal sources (channels or imported files), sinks (displayed plots), and processing blocks between them in an arbitrary DAG
10:06marcanah, neat
10:07lain has joined #asahi-gpu
10:10azonenbergAnyway, so right now it won't run on any apple platform unless it's an x86 that you dual boot linux on
10:10azonenbergHence being interested in potential for it to work on M1 at least under linux
10:10azonenberglong term a community opengl 4.x implementation that runs under osx would be nice :p
12:55choozy has joined #asahi-gpu
13:15bloomcompute shaders will happen wen they happen, easier tha 3D but less fun :-p
14:19choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
15:35choozy has joined #asahi-gpu
16:30odmir has joined #asahi-gpu
16:35odmir has quit [Ping timeout: 268 seconds]
18:31azonenbergOut of curiosity if you're not reversing any apple driver code or decapping the chip, how are you figuring out anything about the register interface?
18:31azonenbergpoking registers at random seems likely to end badly and not tell you very much
18:32azonenbergi assumed most of this kind of stuff had to be done by finding someone in a suitably friendly jurisdiction to reverse the relevant tidbits then write a clean-room spec
18:32azonenbergbut judging by the topic that's not the case
18:33azonenbergor is dynamic analysis fair game?
18:33azonenbergwatching memory accesses via jtag or something while calling various APIs?
18:33jn__blackbox dynamic RE is the way, AFAIUI
18:34jn__watching library calls by apple's equivalent of LD_PRELOAD
18:34azonenbergthe last time i was faced with such a problem it was a xilinx fpga bitstream
18:34azonenbergand my solution was to decap the chip and trace out the circuits :p
18:34azonenberginterestingly enough, under US law semiconductor RE is explicitly protected and legal
18:35azonenbergso it's less gray than anything software related
18:35azonenbergYou're even explicitly allowed to use your findings to inform the design of a new chip as long as you aren't making a verbatim copy of the mask layout, or infringing on patents
18:38segherazonenberg: poking randomly is perfectly safe
18:38segheri have done it many times before. yes i know it can be disaster in teory, heh
19:04bloomsegher: I figure poking randomly from unprivileged userspace in a machine with SIP/etc in tact is fair game
19:04bloomAnd if something goes horribly wrong I can file a CVE, win-win ;-p
19:25tomtastic has quit [Ping timeout: 265 seconds]
19:29tomtastic has joined #asahi-gpu
19:29dottedmag has quit [Quit: QUIT]
19:31dottedmag has joined #asahi-gpu
19:31dottedmag has joined #asahi-gpu
19:49segherno, from unlimited mode
19:49segheryou can map out where there is mmio, what blocks are aliased, etc.
19:51segheranything that can destroy hardware needs some specific sequence these days (since the 90's or so), not just one poke
19:53segherbut yes you never know. take a risk :-)
19:58jixi did poke random MSRs on my ryzen to find the chicken bit to make rr work and I didn't even manage to crash my machine doing that... was much less exciting than I thought it would be ;)
19:58opticronheh...reminds me of a PCI card produced at a company I worked for a long time ago. there was a two-color LED on the back panel, the hardware was missing an interlock, and the driver had a bug that allowed the wrong transistors to be turned on at the same time during a race condition which blew out the LED trace and could cause a fire
19:59Yuzuthat's a significant failure mode
20:01segheryes, anything external hardware (external to the chip) can do very bad things
20:01segheropticron: that is badly designed hardware of course, but :-)
20:02seghereven just adding a dum resistor would help, heh
20:02opticronif it was in the right place, yes
20:03segherwell sure, heh
20:03segherbut you should have anything to limit current on otherwise possibly wide-open paths
20:06opticronI think there *was* a resistor there, but it just wasn't across both of the two possible power-to-ground paths
20:07opticronprobably not across either of them, just next to the LED
20:53jixyeah, that rr, some speculation that amd does affects performance counters in a way that breaks rr... so you need to turn that off https://hackmd.io/sH315lO2RuicY-SEt7ynGA?view has a write up of all that (I didn't do much apart from making educated guesses where to find the bit and trying those on my HW, others already figured out what the issue is and that some chicken bit to disable it is
20:53jixlikely to exist)
21:13qyousef has joined #asahi-gpu
21:15choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
21:16qyousef_ has quit [Ping timeout: 268 seconds]
21:27sorear has joined #asahi-gpu
21:35qyousef_ has joined #asahi-gpu
21:38qyousef has quit [Ping timeout: 240 seconds]
23:11juh has joined #asahi-gpu
23:21juh has left #asahi-gpu ["departed"]
…