@karolherbst@chaos.social titelbild
@karolherbst@chaos.social avatar

karolherbst

@karolherbst@chaos.social

Linux Graphics Developer
Freedesktop Code of Conduct Enforcement team member

Mostly working on Rusticl and Nouveau
Implemented OpenCL in Rust for fun

🏳️‍🌈🏳️‍⚧️ are welcomed.

Nazis, $hitcoin cultists, Right-Libertarians, Longterminists, Tankies, techbros and other fascists not welcomed. This is a shithead free zone.

Private account, please direct all business inquiries to: https://twitter.com/karolherbst

#mesa
#nouveau
#nvk
#opencl
#rust #rustlang
#rusticl
#coc

Dieses Profil is von einem föderierten Server und möglicherweise unvollständig. Auf der Original-Instanz anzeigen

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

I'm currently looking into what's the best way to support SVM/USM in #rusticl and one thing I'm wondering about is, if there are any drawbacks doing:

mmap(some_chosen_address, ram_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED_NOREPLACE, 0, 0);

and reserve a lot of virtual memory, and then suballocate SVM allocations out of this region with "PROT_READ | PROT_WRITE" and "MAP_FIXED"?

Alternatively, I was considering allocating smaller heaps on demand.

karolherbst OP ,
@karolherbst@chaos.social avatar

@jhwgh1968 nah, FIXED_NOREPLACE just means the mmap call won't replace existing mappings.

karolherbst OP ,
@karolherbst@chaos.social avatar

@jhwgh1968 mhhh.. I can't really sub-allocate, because after munmap the original mapping is just gone as well...

though maybe I can make it work without reserving such a huge range, but I'm kinda worried about fragmentation, but... maybe that's fine...

karolherbst OP ,
@karolherbst@chaos.social avatar

@lina @jhwgh1968 yeah, it should.

Which just brings me back to the original question, if reserving that amount of VM space is a good idea and if there are other options.

I also wonder how well that would work with things like libasan, which just allocates 20TB of virtual memory here.

Anyway, it seems like Intel's CL stack just hopes nothing conflicts and maybe I just do the same, because it should be fine (tm).

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

so.. which distribution is not going to patch out this secret chromium extension?

karolherbst OP ,
@karolherbst@chaos.social avatar

@jhwgh1968 apparently chromium has a private extension users can't disable, which grants *.google.com domains special privileges and access to private APIs.

Apparently the same extension is also available on edge.

See https://fedi.simonwillison.net/@simon/112757810519145581

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

soooo.. in OpenCL C builtins like get_global_offset have to return defined values on out of bound accesses, but apparently Intel's driver also gets this wrong. Now I'm considering if I should keep it broken as well, or actually fix it as defined in the spec...

@bashbaug any thoughts on this? Maybe we should add OpenCL CTS tests for this and annoy everybody else with this?

karolherbst OP ,
@karolherbst@chaos.social avatar

@bashbaug we have some custom CL tests in piglit and this one seems to fail on my Intel one: https://gitlab.freedesktop.org/mesa/piglit/-/blob/main/tests/cl/program/execute/global-offset.cl?ref_type=heads#L97

It's the last "[test]" section in that file in case you want to adjust your local test program.

Here it returns "3" instead of "0" in the last line.

karolherbst OP ,
@karolherbst@chaos.social avatar

@bashbaug I think this issue should exist with all builtins, but I'm wondering why the SPIRV-Translator is the best place, because I was seeing this with Intel-compute-runtime using OpenCL C as well.

Not saying that it won't make sense to fix it in the translator, but I think it depends on what's meant with "The mapping from an OpenCL C built-in function to the SPIR-V BuiltIn is informational and non-normative." in the env spec.

karolherbst OP ,
@karolherbst@chaos.social avatar

@bashbaug oh, I wasn't aware that you are also using SPIR-V internally. Is that an old change or something more recent?

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

what a relief to be honest

karolherbst OP ,
@karolherbst@chaos.social avatar

@jonkoops @karl I just hope that whatever government will be formed after that won't do the same mistakes as we e.g. see in Germany.

But it's going to be tough I bet.

18+ karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

the social democratic leadership sees austerity as the only option.

The same as 95 years ago.

It's really heartbreaking seeing political leaders doing the same mistakes over and over again.

karolherbst OP ,
@karolherbst@chaos.social avatar

@nCrazed I'm sure they do it deliberately in the meaning of "that's how the system works and that's what we have to do", but not deliberately in the sense of "haha, we want to ruin our system".

And people like the FDP finance minister just say, that they don't believe the studies claiming it does...

Maybe it's deliberate from the "liberals", but uhh.. I think they are just ideologically blinded.

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

I think the funniest part of the new POSIX version is the removal of "ioctl"

karolherbst OP ,
@karolherbst@chaos.social avatar

@VegaHarmonia yeah, it was kinda weird having it in posix in the first place, because it was all implementation defined anyway. So they removed it, because POSIX really has no business there.

karolherbst OP ,
@karolherbst@chaos.social avatar

@VegaHarmonia it's mostly funny in regards to POSIX purists and them not wanting to use non POSIX stuff in software.

Granted, you almost never need to use ioctl directly in most cases, but still...

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

I've finally finished the work to fix the spirv linker so it can link programs together originating from llvm-17 or newer.

Yes, this is a dirty workaround, but apparently we have no other options at this point.

https://github.com/KhronosGroup/SPIRV-Tools/pull/5534

karolherbst OP ,
@karolherbst@chaos.social avatar

@Man2Dev this PR only really matters if you link two spir-vs together, which I think besides mesa almost nobody is doing anyway, I think.

TheEvilSkeleton , an Random Englisch
@TheEvilSkeleton@treehouse.systems avatar

"Keep politics out of FOSS" is an interesting political statement

karolherbst ,
@karolherbst@chaos.social avatar

@TheEvilSkeleton what did I miss, or is it that new fancy web browser thing?

18+ karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

protect yourself from all openssh vulnerabilities with this little trick:

systemctl stop sshd; exit

18+ karolherbst OP ,
@karolherbst@chaos.social avatar

@brayd I've warned y'all

karolherbst , an Random Englisch
@karolherbst@chaos.social avatar

anyway, some 🦀 content today:

I'm considering using serde in rusticl, however my use case is not to parse arbitrary data, but always structs with no custom data allowed. In short: the struct defines the data layout.

And we have some helpers in mesa dealing with reading/writing data to a blob.

So I'm wondering if a custom serde serialize/deserializer is what I want, or if I want something more special/focused as serde seems to be too generic for my use case here.

karolherbst OP ,
@karolherbst@chaos.social avatar

@matt it's C code and we use it for e.g. serializing GPU shaders so it can be stored in a shader cache. But it's all manual serialization and deserialization code, it's just mostly there to deal with alignment, padding and buffer overruns (like you can check if the buffer used for reading/writing wasn't big enough and handle it).

So, because writing the code yourself is annoying I was wondering if something can take a struct and generate the code for me in rust.

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine