MCMT

MCMT

95.3k Downloads

Executing on an Gpu?

NXTler opened this issue · 8 comments

commented

Hey this is more or less a question of mine. So as we all know Gpus have a lot of power and minecraft dont touch that power at all. I searched a bit for what effect it could have if we run the minecraft worldgen on an Gpu and in theory this is a big deal. So my question is can add a worldgen or other features like this too this mod to harness that power?
I basicly allready know the answer. Its way to complicated to make this happen. I think I just want to inspire people that are way better at programming then me or you so at one day we could have it.
maybe...

her is some interesting stuff to that topic:
http://mc-server.xoft.cz/docs/Generator.html#GPU
https://github.com/minecrafthome/minecraft-beta-alpha-terrain-generation-cpp
https://pubs.cs.uct.ac.za/id/eprint/1052/1/Crause_Thesis_Revised.pdf

commented

For me it's not worth it cuz terrain is generated once and the lag can be resolved with pregeneration. In 1.15.2 lag with terrain gen is very small compared to 1.12.2.

commented

@KubiRem I dont mean to make it less lagi for the client side. For servers this could mean generating chuncks at a high rate for many players at the same time because gpus have many threads that are extremly parallelised.

commented

@KubiRem I dont mean to make it less lagi for the client side. For servers this could mean generating chuncks at a high rate for many players at the same time because gpus have many threads that are extremly parallelised.

Gpu works not like CPU. And it's not designed to be CPU. Yeah it could be faster for noisegen etc but in most cases it would be much much slower than normal CPU. CPU threads and GPU threads are not the same thing,

commented

Ok, so to summarise stuff about this:

This is something I might look into in the future, but would require a LOT of work

The primary issue would be ensuring the GPU side works the same as the CPU side to avoid wierd generation borders like you get between some game versions

The other issue would be the amount of stuff that you could do on the GPU; The minecraft world gen is done in stages from what I can gather; it requests a fully loaded chunk first, which then requests a partly generateted chunk, which requests an even less generated chunk, etc.

This wouldn't work well on the GPU and I'd need to probably rewrite a lot of this process

The noisegen itself could possibly be done on the GPU, but that ends up being a small amount of stuff as far as I can tell. The heavier weight stuff is the propogation of actual structures in world (caves, trees, temples, etc.) which is what I'm currently looking at as it seems to be what causes world lockups.

commented

Ah that’s good to hear. Is the world hickups happening on its own, or is there another mod causing it?

commented

@KubiRem For servers this could mean generating chuncks at a high rate for many players at the same time because gpus have many threads that are extremly parallelised.

Servers with that many player usually run on dedicated server with only CPU but no GPU...

commented

@Naheulf This is the point with gpu execution in experiments gpus were just better than cpu in many cases but to make a gpu run a minecraft server is extremly difficult

commented

Yes GPU execution is not needed. It would not be beneficial at all.