FarPlaneTwo

FarPlaneTwo

18.5k Downloads

Poor performance with official AMD graphics driver

DaMatrix opened this issue ยท 14 comments

commented

When using the official driver for AMD GPUs, the the game performs extremely badly when fp2 terrain is visible (0-1 FPS with heightmap mode using 32cutoff@1level).

The issue does not occur with older versions of the driver.

The issue does not occur when using the open-source AMD drivers on Linux, but using an otherwise identical configuration.

commented

On my RX580(8GB) system my fps is about 20 with heightmap mode using 32cutoff@1level, limited testing concludes changing gpu settings in the radeon driver doesn't change this.
When disabling fp2 rendering by turning off level 0 rendering fps returns to normal.

edit: It is also a known issue that AMD OpenGL performance is worse on Windows

commented

possibly related: segfault from the AMD driver (from normal mc code): hs_err_pid17696.log

hopefully fixing the performance issue will also fix the segfault, otherwise i'll move it to a separate issue (assuming it can be reliably reproduced)

commented

i've managed to narrow it down to the baseVertex parameter to opengl draw calls. increasing the value of baseVertex causes a proprortional drop in performance (which is obviously extreme in a real fp2 frame, where this value can easily go into the millions). additional findings:

  • a value of exactly 48814 makes the upper right half of the screen solid black (see screenshot)
  • 48815 and up make the entire screen black

(tested on heightmap mode)

i'm honestly kind of stumped here. baseVertex is the key to not having to switch between hundreds of different vertex arrays when rendering, avoiding use of it would cause a massive performance hit which couldn't be worked around by multithreading.

commented

one possible workaround would be to use GL_UNSIGNED_INT instead of GL_UNSIGNED_SHORT on AMD cards, at the cost of doubling the index buffer's VRAM consumption as well as the memory bandwidth needed to access it.

commented

By the way, what is heightmap mode? I saw a few people saying they're using it but I'm not 100% sure how to access it.

commented

@blueberryperson5 in fp2 settings, change the mode from voxel to heightmap.

that question would be better suited for the discord, or a separate issue, or literally anything other than an issue regarding driver performance.

commented

Oh, well I just wanted to confirm whether the problem was that I was not using heightmap, but it also didn't work. The bugs looked very different though.

commented

I also have an RX580 and I downgraded my AMD drivers to 17.12.1 as suggested, but running FP2 with and without Cubic Chunks gives the same result in-game: Less than 0 FPS with constant freezes and weird lines and rendering bugs across the screen and even in the pause menu. I've messed with the FP2 settings a bit but I'm not familiar with how anything works. Is there any setting I need to edit in order for it to work properly with AMD or does my computer just suck?

commented

no, it's certainly an issue with the AMD driver. AMD's support for OpenGL is notoriously bad, there's really not much that can be done on your end.

i was informed by one of my discord members that they'd gotten it working properly on 17.12.1, but if that didn't solve the issue for you, i guess that was either something specific to that driver version+their GPU model, or something else entirely. i'll update the FAQ to specify that it may or may not work.

that said, i hope to get more work done towards fixing this issue today.

commented

another update: i actually spent hours implementing rendering with GL_UNSIGNED_INT indices pre-offset by baseVertex (in order to allow baseVertex to always be 0) and performance is still equally bad.

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

commented

Perhaps implementing something like this might be possible?

https://www.collabora.com/news-and-blog/blog/2018/10/31/introducing-zink-opengl-implementation-vulkan/

It's a long shot, but I still think it's worth a try if there's nothing else.

commented

Zink Now Supports OpenGL 4.5 Over Vulkan With Mesa 21.1

Microsoft is also working on an OpenGL to DirectX 12 layer but this seems to be OpenGL 3.3 max

commented

Screenshot_20210524-165526
Supports Opengl 2.1
Make sure you read the links you send, friend!

commented

this should be resolved in the latest commit, please put comment here if you still experience it