17:47 phodius[d]: does nouveau work with the rtx 3070 laptop im trying to get it to work?
19:10 karolherbst[d]: depends on the rtx 3070
21:32 phomes_[d]: I am looking again at some misrendering in the game "The surge 2". The problem looks like this:
21:32 phomes_[d]: https://cdn.discordapp.com/attachments/1034184951790305330/1262522312482099220/image.png?ex=6696e707&is=66959587&hm=3d987885a5210d6ef5dcd9d91073e48c9af1f8f9ab6cf9d99cacc991b014eebb&
21:33 phomes_[d]: I have a capture in renderdoc. I found the responsible draw and debugged a few of the wrong pixels.
21:33 phomes_[d]: It seems that when I step through the spirv it calculates the correct values though.
21:33 phomes_[d]: I do not know renderdoc all that well yet. Is it stepping through the spirv with its own implementation and the draw is performed with nvk?
21:38 karolherbst[d]: none of the mesa drivers support GPU side single-stepping
21:39 karolherbst[d]: phomes_[d]: anyway, does `zero_vram` change anything there?
21:39 phomes_[d]: it does not
21:40 karolherbst[d]: do you have the MR applied for that?
21:40 phomes_[d]: the wrong pixels also change when moving the camera
21:40 clangcat[d]: phomes_[d]: So from what I understand for vulkan renderdoc uses. Vulkan layers, so it's kinda callbacks and such. I'm not sure how you single stepping. But I'd hazard a guess that it's probably using a texture for the text and it maybe didn't zero the memory of the texture(would be my first guess).
21:40 clangcat[d]: phomes_[d]: Oh. :P
21:40 karolherbst[d]: phomes_[d]: yeah sure, but that game does have a zero vram entry for radv
21:41 karolherbst[d]: but if you have the MR applied and verified it actually does get applied, then it's probably something else
21:42 phomes_[d]: let me retest again
21:44 clangcat[d]: karolherbst[d]: is zero vram just making it so things like Textures and other bits are guaranteed to be zeroed out on creation? Tbh Idk I've never not zeroed a texture but I assume they would probably hold random data if they weren't previously cleared?
21:44 karolherbst[d]: clangcat[d]: yeah..
21:45 karolherbst[d]: I think in the windows world you are guaranteed to get zeroed memory, where in Linux...
21:45 phomes_[d]: I retested with zero vram and it did not fix it
21:46 clangcat[d]: karolherbst[d]: Interesting. I suppose both have there benefits.
21:46 karolherbst[d]: phomes_[d]: disappointing 😄
21:46 karolherbst[d]: clangcat[d]: nah.. Linux doesn't do it, because nobody found time to do it properly without hurting perf too much
21:47 phomes_[d]: It was the first thing I tried so I was fairly sure about the result 🙂
21:47 karolherbst[d]: it's a real pain to add that in Linux, due to how `ttm` works
21:48 clangcat[d]: karolherbst[d]: Yea was gonna say. Benefit is it's cleared. Downside if you just initialize the texture the clearing of vram is technically wasted instructions.
21:48 phomes_[d]: when I start games like X4 Foundations and it starts with a "screenshot" of some other game I ran early I do worry a little
21:48 karolherbst[d]: clangcat[d]: so.. this does have security implications though, because atm in Linux you can get rendered firefox frames with a little tool just reading out VRAM
21:48 karolherbst[d]: but...
21:49 karolherbst[d]: the smart way of doing that is to keep track if the allocated VRAM pages was used by a different process before and just clear when something else used it before
21:49 karolherbst[d]: and to prefer pages the application owned previously
21:49 karolherbst[d]: you can do that pretty cheaply, just have to do all the smartness
21:50 clangcat[d]: karolherbst[d]: Yea downsides and upsides to both. Though technically by that logic it's possible to get a user password from a `malloc` if some other program/kernel hasn't cleared `free` buffer.
21:50 clangcat[d]: Ideally if your doing something security focused your app should also trash the content when you are done with it. But yea I get your point it is possible no matter how unlikely.
21:50 karolherbst[d]: oh and you'd probably have a background job clearing memory while idling or something
21:51 karolherbst[d]: and keep a bucket of zeroed VRAM quickly available
21:51 karolherbst[d]: clangcat[d]: well...... yeah, but texture memory is way harder to parse
21:51 karolherbst[d]: attacks aren't really feasible, though with AI it might be feasible :ferrisUpsideDown:
21:52 karolherbst[d]: but you could also OCR
21:52 karolherbst[d]: just have to figure out the memory tiling
21:52 karolherbst[d]: and where it starts
21:52 karolherbst[d]: it's a real complex problem
21:53 karolherbst[d]: the problem with the latter is, that some drivers just allocate a new buffer object if you clear the entire buffer :ferrisUpsideDown:
21:53 karolherbst[d]: and the old buffer just keeps the old content you wanted to overwrite
21:53 clangcat[d]: karolherbst[d]: Oh yea it's not really super feasible. But it's the technicality of yea it's technically possible. Same with like getting a buffer that was used by something secure previously it's possible but a little unlikely.
21:53 clangcat[d]: phomes_[d]: What do you mean by this btw?
21:54 phomes_[d]: clangcat[d]: That game needs zero vram or else it will show random stuff from uncleared memory for a few seconds
21:54 karolherbst[d]: the memory allocater in nouveau is pretty deterministic even
21:54 phomes_[d]: Mostly whatever game I was testing before
21:54 clangcat[d]: phomes_[d]: Oh yea I mean that's "fine"
21:55 clangcat[d]: It's not great
21:55 clangcat[d]: but it's not like something that is a bad sign for your GPU so to speak.
21:56 phomes_[d]: only bad for my privacy 🙂
21:56 clangcat[d]: Yea it's just buffers being carried over. Likely because most of your games will run at full screen and so similar buffers are being chosen.
21:56 karolherbst[d]: phomes_[d]: but gotta say, that really looks like uninitialized memory :ferrisUpsideDown:
21:56 clangcat[d]: phomes_[d]: Yea pretty much it's tricky in that technically something can decode that data.
21:57 karolherbst[d]: you sure you have the MR applied locally?
21:57 clangcat[d]: karolherbst[d]: I second that it does strike me as uninitialized memory in the texture.
21:57 phomes_[d]: in renderdoc when I step through the spirv it seems to be able to get the correct values from the texture with the font. Does that hint at something useful? Can I use that to narrow down where the problem is?
21:57 karolherbst[d]: this one: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29892
21:58 clangcat[d]: clangcat[d]: Cause it does seem like the game is rendering the font into a texture. But it's never zeroing the VRAM and it only renders just the characters not the full bounding box so you end up with the characters with "random" pixels around them.
21:58 karolherbst[d]: it just looks like it assumes the alpha is 0 by default
22:00 clangcat[d]: karolherbst[d]: Yea just when it rendered the chars it only rendered the chars and left the other data untouched. Which if it's game for windows would make sense. if windows guarantees that.
22:00 karolherbst[d]: yep
22:01 phomes_[d]: I am retesting and this time with printfs to make sure it is also doing it
22:02 clangcat[d]: karolherbst[d]: I mean personally I kinda hate it. just in the honestly you should init stuff even if specs technically state they'll do it for you. But I think that's just BIOS taught me to trust nothing you didn't set yourself..
22:02 karolherbst[d]: I don't even trust myself setting something
22:04 clangcat[d]: karolherbst[d]: Yea my point is just like ideally don't trust stuff you don't init. Cause you don't know when something might not follow spec as it's laid out.
22:04 phomes_[d]: I retested with printfs to ensure that we zero vram. Still not fixing it
22:04 notthatclippy[d]: karolherbst[d]: Since this is Discord channel #nouveau🔗, I _think_ you can get the GSP to do the dirty scrubbing work asynchronously via a CE. I'll check tomorrow what the relevant APIs are.
22:05 karolherbst[d]: notthatclippy[d]: oh wow... that would be useful indeed
22:05 karolherbst[d]: even offloaded from the CPU
22:05 karolherbst[d]: impressive
22:06 notthatclippy[d]: We definitely do it async and only block allocations if there's no scrubbed pages available but I think most of the stuff is on GSP behind some API. It's been a while...
22:08 notthatclippy[d]: karolherbst[d]: We had an intern demonstrate this bug once, by using **very** NSFW private browsing images. Certainly got the point across, so it got fixed.
22:09 phomes_[d]: https://cdn.discordapp.com/attachments/1034184951790305330/1262531515607154748/image.png?ex=6696ef9a&is=66959e1a&hm=5969148e85bfe7087db2148e85472e2d36fc608059c49c23c83599a75c550e67&
22:09 phomes_[d]: The game is reading from this texture and when stepping it through I could see it getting the correct values in renderdoc
22:09 karolherbst[d]: notthatclippy[d]: heh
22:10 clangcat[d]: notthatclippy[d]: Honestly I approve of the choice of images.
22:15 clangcat[d]: phomes_[d]: Hmm does seem clear maybe karolherbst[d] or one of the peoples knows more sorry. But yea very strange.