Elektrine lite

← Feed

@transcendentempress@eldritch.cafe

Post #1769689

2026-04-29 07:39 UTC

Always wondered, when it comes to program stuff that nowadays you can do on both, performances aside, would you say it's more complex to use CPU or GPU?

Replies (3)

  • @theartlav@anarres.family 2026-04-29 08:51

    @transcendentempress@eldritch.cafe Using the GPU tend to require a bunch of extra setup, as you are driving if from the CPU. And it's tricky to debug the code on it, so common practice is to write the code on the CPU first to make sure it works correctly. Meaning you are likely to write the code twice. GPUs tend to be easy to program when your computation doesn't need much synchronisation, but quickly starts to get nightmarish as more inter-thread dependency is added. Performance tend to not be portable between GPUs, especially of different vendors, because you need to tune the code to the architectural peculiarities and manage the buffers/bus differently. Long story short, it depends.

    Open ##1769688

  • @spacekatia@girlcock.club 2026-04-29 08:03

    @transcendentempress@eldritch.cafe (it depends on what youre doing? running stuff on the gpu usually requires a bunch more setup, unless you're doing 3d video game graphics also depends on the abstraction layer you're working on like, if you wanna write some lua, that's gonna be more complex to get working on the gpu than writing something on the level of c but in general the big difference is still: your code is running on the cpu by default cause thats where all the other code is running)

    Open ##3161480

  • @jenesuispersonne@piaille.fr 2026-04-29 09:33

    @transcendentempress@eldritch.cafe IMPOV GPU is harder at debugging even with modern tooling and performance results can change widely depending on graphical hardware engine and driver support. Also speeking about performances, you have to take in account few things more: - Your graphics pipeline has really poor performance on branching (basically it executes both branches) - If you load 1 big memory block and compute on it, it's ok; But if you try to stream data to GC memory, you will have trouble with PCIe transfers (same for data going back to CPU)..

    Open ##3161481