Minetest Servers and GPUs

Post Reply
User avatar
DELTA_FORCE
Member
Posts: 165
Joined: Tue Oct 30, 2018 01:26
IRC: DELTA_FORCE
In-game: DELTA_FORCE
Location: ee

Minetest Servers and GPUs

by DELTA_FORCE » Post

Moderator note: split from viewtopic.php?f=10&t=23143
runs wrote:
Sun Nov 28, 2021 22:38
- AMD Ryzen 5 5600G with Radeon Graphics (August 21)
- 16 GB RAM
- M2 Disk X6 SPEED
- Nvidia 1060 Last Generation Graphic Card!!!!

My personal computer runs a 5700G, 32gb PC428800 and an RTX 2060. Also running a Samsung 980 EVO. I expect performance will be okay, but the GPU has jack shit to do with performance in MT.
check me out nowhere because i never do anything

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [12-12-21] JUANCHI SERVER

by runs » Post

DELTA_FORCE wrote:
Sun Nov 28, 2021 23:13
My personal computer runs a 5700G, 32gb PC428800 and an RTX 2060. Also running a Samsung 980 EVO. I expect performance will be okay, but the GPU has jack shit to do with performance in MT.
Servers don't need GPU, but CPU.

User avatar
emperor_genshin
Member
Posts: 83
Joined: Tue Dec 22, 2015 05:04
GitHub: GenshinMT
IRC: Genshin
In-game: Genshin
Location: [REDACTED]
Contact:

Re: [12-12-21] JUANCHI SERVER

by emperor_genshin » Post

runs wrote:
Sun Nov 28, 2021 23:14
Servers don't need GPU, but CPU.
Image
I'm just a individual who likes to make impressive things. | Current Mod: Dungeon Crawl Maker https://www.youtube.com/watch?v=c6g6H2kLBpg

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [12-12-21] JUANCHI SERVER

by runs » Post

emperor_genshin wrote:
Sun Nov 28, 2021 23:27
runs wrote:
Sun Nov 28, 2021 23:14
Servers don't need GPU, but CPU.
Image
Very simple, the CPU is the "brain" of a PC, and the GPU are the "eyes". The Minetest Server in console mode (not graphics) only uses its brain.

User avatar
DELTA_FORCE
Member
Posts: 165
Joined: Tue Oct 30, 2018 01:26
IRC: DELTA_FORCE
In-game: DELTA_FORCE
Location: ee

Re: [12-12-21] JUANCHI SERVER

by DELTA_FORCE » Post

The CPU handles sequential operations very efficiently. It has a larger instruction set over a GPU. A GPU is slower when it comes to single thread performance, but excels in tasks where parallelization may be utilized over sequential operations due to GPUs running many threads.

To give you a little bit of history, Nvidia's CUDA technology was developed in 2007 as a means of controlling these cores and utilizing them for these tasks for independent developers. They core counts have increased significantly in size, my RTX 2060 having 1920 of them and my Tesla K80s having nearly 5000 respectively.

The GPU is not the eyes of the computer. It simply does a better job of performing the billions of calculations per second (in a standard monitor, 1920x1080, that's over 2 billion pixels at 60hz, each with RGB channels) over a cpu. This may also be apparent if your gpu runs into problems and forces the cpu to render a desktop at a lower resolution.

Something I could imagine the community appreciating can be done by you. Read up on some CUDA documentation and maybe try utilizing that 1060 of yours to take advantage of the parallelization that it provides. Mapgen, physics, or other complex interactions performed many times would be great places to start. As you said, if it's just console or no graphical output at all, you might as well give that GPU something to do.
check me out nowhere because i never do anything

User avatar
ywwv
Member
Posts: 299
Joined: Mon Jan 18, 2021 11:51

Re: [12-12-21] JUANCHI SERVER

by ywwv » Post

too bad that minetest server does not use the GPU in any way. which is what runs was demonstrating. until those features are a reality it is not relevant to the performance or operation of a minetest server. so his basic point is correct

its interesting to imagine a future where the GPU is used. this would be useful for people with bedroom servers that have GPUs attached. but if you purchase a VPS you will generally not have a GPU attached ( that costs a lot of extra money) nor will you be able to optimally use a GPU resource like that to make it have any reasonable return on investment. (in a datacenter situation , where you pay for allotted time on the GPU, any time that is not spend computing is wasted money) once the mapgen is run, can the GPU justify itself? I don't think so.

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: [12-12-21] JUANCHI SERVER

by Festus1965 » Post

DELTA_FORCE wrote:
Sun Nov 28, 2021 23:13
I expect performance will be okay, but the GPU has jack shit to do with performance in MT.
Depends,
if it is only dedicated server, and not at home, where you use monitor for show you htop, terminal mt etc as I do at home, the extra GPU is useless.
But if using at home and use monitor there also, it will also reduce any plus load on the internal inside CPU GPU and help also.

I have extra Grafic and 2 Monitor fixed, where I check htop, terminal ... and also have the admin client logs running over.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Minetest Servers and GPUs

by rubenwardy » Post

Both Delta and ywwv are correct here.

The Minetest server doesn't currently use the GPU, and getting a VPS with a GPU attached is usually a magnitude more expensive. You would need to justify the added cost in terms of hardware and development times with the performance improvement. It would interesting to see GPU-based map generation. But I'd settle for GPU-based graphics :)

I've used OpenMP and CUDA before, and it's just an absolute pain

Just a warning to everyone: please converse civilly and constructively without derailing the conversation
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Minetest Servers and GPUs

by Linuxdirk » Post

rubenwardy wrote:
Mon Nov 29, 2021 12:17
The Minetest server doesn't currently use the GPU, and getting a VPS with a GPU attached is usually a magnitude more expensive.
Mainly because it wouldn't be a VPS anymore but real hardware for you only so your applications have dedicated access to the GPU.

I wonder if Minetest would actually benefit from using CUDA. I know that rendering videos does (I occasionally do this), 30-40 FPS without CUDA and over 600 FPS when using a CUDA-enabled encoder on my machine - depending on raw video material, though.

User avatar
DELTA_FORCE
Member
Posts: 165
Joined: Tue Oct 30, 2018 01:26
IRC: DELTA_FORCE
In-game: DELTA_FORCE
Location: ee

Re: Minetest Servers and GPUs

by DELTA_FORCE » Post

rubenwardy wrote:
Mon Nov 29, 2021 12:17
Both Delta and ywwv are correct here.

The Minetest server doesn't currently use the GPU, and getting a VPS with a GPU attached is usually a magnitude more expensive. You would need to justify the added cost in terms of hardware and development times with the performance improvement. It would interesting to see GPU-based map generation. But I'd settle for GPU-based graphics :)

I've used OpenMP and CUDA before, and it's just an absolute pain
I agree with you here, I would settle for GPU based graphics as well :P Unfortunately, it almost seems like implementing GPU based mapgen would be easier than going through the nightmare that is Minetest and irrlicht, the rendering engine and all that is involved there. CUDA itself is also agreeably a pain at first, and I find that the best way to handle that workflow is to predetermine how you go about implementing it, so there is less guess work and you are only struggling with CUDA documentation.

If someone wouldn't mind pointing me in the right direction, I would appreciate learning how to have external programs interact with Minetest. It could be as simple as executing a binary compiled with nvcc and having the result returned to the mod for further processing, or interacting with the engine/mod in real time. Any doable ideas for a modder with some experience would be greatly appreciated, and as I have stated before, I have more than plenty of resources to mess around with.
check me out nowhere because i never do anything

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Minetest Servers and GPUs

by Blockhead » Post

Considering the wide range of hardware and operating systems Minetest supports, the only clear choice for a graphics API is OpenGL, which is what we use. Similarly, for heterogeneous computing APIs, to choose CUDA is to exclude all non-NVIDIA cards from using whatever you want to use CUDA to accelerate in Minetest. It would be better to choose a non-proprietary solution like OpenCL, which will actually run on AMD chips and on Android. This degree of parallelisation might indeed be helpful for mapgen, as it's mostly a large number of independent mapblocks generating perlin noise and adding features.

As you mentioned DELTA_FORCE, mapgen could also be moved to an external program, which doesn't necessarily have to be run at the same time as minetest. The mapblock serialisation format is well-documented. For inter-process communication, I don't know if there's a direction method, but I can name plenty of hacks... So far as I know mods mostly use files. Using the UNIX philosophy, this could be a pipe that the external process creates when it starts, and waits for minetest to write to using Lua file I/O functions. The HTTP API is also an option if you wanted to make a REST interface. Finally, the minetest protocol is also documented, so you could connect your mod as a client and have it run chat commands when it wants to send data back to the server, and receive data in chat messages. That's the most hacky of my ideas :)

As for minetest performance, it's well known that having a busy CPU will kill your framerate, to different degrees depending on whether you're running a listen server, running a dedicated server on the same hardware or just connecting to the server remotely. I also don't have anything to quantify that nor do I understand the architecture. I can only hazard a guess that the CPU being so busy means it lacks the time to send rendering data to the GPU. I suggest anyone who wants to know why the framerate is so heavily tied to the CPU doesn't prolong the thread unnecessarily with vain guessing about the source of the issue and actually gets down to measuring and probing the software on their own computer.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: Minetest Servers and GPUs

by runs » Post

Not related but...

I used to play Minecraft in singleplayer as a server, I mean, playing alone as a server (within the same game, not on console), I was playing faster and happier than pure singleplayer. It is as if Minecraft created two separate processes, even with the same executable, and that made it easier for it than pure singleplayer.

I tried it, to do the same with Minetest, but it doesn't work the same, but worse, the other way around than Minecraft, it's as if the game was saturated with the two processes.

User avatar
DELTA_FORCE
Member
Posts: 165
Joined: Tue Oct 30, 2018 01:26
IRC: DELTA_FORCE
In-game: DELTA_FORCE
Location: ee

Re: Minetest Servers and GPUs

by DELTA_FORCE » Post

Blockhead wrote:
Mon Nov 29, 2021 16:52
Considering the wide range of hardware and operating systems Minetest supports, the only clear choice for a graphics API is OpenGL, which is what we use. Similarly, for heterogeneous computing APIs, to choose CUDA is to exclude all non-NVIDIA cards from using whatever you want to use CUDA to accelerate in Minetest. It would be better to choose a non-proprietary solution like OpenCL, which will actually run on AMD chips and on Android. This degree of parallelisation might indeed be helpful for mapgen, as it's mostly a large number of independent mapblocks generating perlin noise and adding features.
You would be completely correct in using OpenCL for cross platform, however these are optimizations that only a server would really see the benefits of (for the most part). Because of that, and the fact most servers run Nvidia cards, I feel it would be better for performance (and for the sanity of the poor programmer) to just do it in CUDA. I made this sort of subthread initially as server only, as larger servers will really see the benefit of the parallelization the GPU is able to provide over individual clients.
runs wrote:
Mon Nov 29, 2021 20:15
I used to play Minecraft in singleplayer as a server, I mean, playing alone as a server (within the same game, not on console), I was playing faster and happier than pure singleplayer. It is as if Minecraft created two separate processes, even with the same executable, and that made it easier for it than pure singleplayer.
You are correct, it isn't related. My best guess to what you are trying to say and achieve can be described with the following probably-incorrect-psuedocode-but-not-really-psuedocode:

Code: Select all

./minetest --server --world w001 --port 30000 &
./minetest --address --name delta --port 30000 --go
check me out nowhere because i never do anything

User avatar
ywwv
Member
Posts: 299
Joined: Mon Jan 18, 2021 11:51

Re: Minetest Servers and GPUs

by ywwv » Post

Linuxdirk wrote:
Mon Nov 29, 2021 12:29
rubenwardy wrote:
Mon Nov 29, 2021 12:17
The Minetest server doesn't currently use the GPU, and getting a VPS with a GPU attached is usually a magnitude more expensive.
Mainly because it wouldn't be a VPS anymore but real hardware for you only so your applications have dedicated access to the GPU.

I wonder if Minetest would actually benefit from using CUDA. I know that rendering videos does (I occasionally do this), 30-40 FPS without CUDA and over 600 FPS when using a CUDA-enabled encoder on my machine - depending on raw video material, though.
Actually you can rent out time on a "virtual GPU". that is shared with many other users in a datacenter environment. see: https://blogs.nvidia.com/blog/2018/06/1 ... rtual-gpu/ .

User avatar
DELTA_FORCE
Member
Posts: 165
Joined: Tue Oct 30, 2018 01:26
IRC: DELTA_FORCE
In-game: DELTA_FORCE
Location: ee

Re: Minetest Servers and GPUs

by DELTA_FORCE » Post

ywwv wrote:
Mon Nov 29, 2021 22:27
Actually you can rent out time on a "virtual GPU". that is shared with many other users in a datacenter environment. see: https://blogs.nvidia.com/blog/2018/06/1 ... rtual-gpu/ .
Eh, renting a GPU is impractical for applications like MT. I can also imagine it being more expensive vs. a VPS with a connected gpu or just buying your own. I think GPU acceleration would be nice if applicable, but it loses its value really fast if you are buying or renting hardware just for MT. It's more of a "nice to have" thing if you already have one hooked up.

Personally I don't see the worth in purchasing a GPU for use of CUDA for just a Minetest server. I do however think that if a gpu connected to your server is hardly being utilized, if at all (such appears to be the case of runs), then sure, I think it would be well worth it. After all, it would collect webs anyways :P

Realistically, I can only see GPUs benefiting those who host at home and already own the hardware. Otherwise, it's hard to justify the cost.
check me out nowhere because i never do anything

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 16 guests