Jump to content
The Dark Mod Forums

Very low performance on AMD GPU


lowenz

Recommended Posts

"or they internally convert OpenGL into Vulkan completely" very likely

 

"First of all since I haven't seen this mentioned specifically: Have you ruled out the relatively new volumetric lights as a cause? Set "r_volumetricEnable 0". For me this barely makes a difference, just a few FPS."

 

Of course, the problem is in the soft shadows code

Edited by lowenz
  • Like 1

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Rant:
 

Spoiler

This just feeds my conspiracy theory that AMD are intentionally sand-bagging OpenGL because they want

Vulkan to be the dominant API.

Thus they can avoid the curse of Nvidia's control of the OpenGL ARB committees which have hampered ATI \ AMD many times...

See the ATI \ AMD Superbuffers debacle for an example of this problem:

https://developer.amd.com/wordpress/media/2012/10/SuperBuffers.pdf

Nvidia voted "no superbuffers for you" and AMD had to continue using less than optimal buffer designs.

They might as well call it "The OpenGL ARB committee sponsored by Nvidia" or call the API OpenNvidiaGL

 

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Strange: With 10211 SVN engine I'm getting extremely low FPS all of a sudden, 20 FPS where I normally had 80 FPS. TDM 2.11 Beta 2 engine doesn't do it so it must be the new changes.

It's not the debug engine, running thedarkmod.x64. Not shadow samples this time either, does it with both maps / stencil and soft shadows disabled. No improvement if I use a fresh Darkmod.conf or remove the generated glprogs directory.

Edited by MirceaKitsune
Link to comment
Share on other sites

18 minutes ago, nbohr1more said:

Rant:

The fact that simply renaming your .exe to one of the games used for benchmarking GPUs raises performance suggests that there's something intentional going on here.

Link to comment
Share on other sites

29 minutes ago, Dragofer said:

The fact that simply renaming your .exe to one of the games used for benchmarking GPUs raises performance suggests that there's something intentional going on here.

Or more simply: laziness (=we've optimized for Doom3 and Dark Athena, so take it and be happy)

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

31 minutes ago, lowenz said:

For me performance literally skyrocketed

Shadow Maps MEDIUM!

https://i.postimg.cc/DyZG9FRf/The-Dark-Modx64-2022-12-11-23-01-06-707.jpg

That's awesome, congrats! Though now we have to figure out why it horribly tanked for me instead 😂 Settings are the same only the engine differs, something in this change must have broken it.

Link to comment
Share on other sites

9 hours ago, AluminumHaste said:

I'm compiling latest SVN right now, I'll try on my set up.

Are you windows or Linux? What's your GPU again?

Im on Windows with an RX 460.

Link to comment
Share on other sites

4 hours ago, stgatilov said:

To everyone who can compile from source: try rev 10211.

Also, I would be glad if you actually compare the performance to that of 2.10.
Even if this issue was the greatest one, there could be other reasons for slowdown.

 

By the way, GLSL specification says that all function arguments must be copied.
Although it is normal to expect from GLSL compiler to inline all function calls, then find def-use relations and not copy read-only data. Maybe AMD had to block this particular case for some reason...

Also, I have launched Radeon GPU tools on TDM, and I like it a lot!
Yeah, it has a bit of AMD roughness (most recent version crashes, I had to backtrack about 1 year into the past to find working version), but I like how open they are. They just write down all the information they measure, without trying to protect developer from information overload. So much stuff there...

One interesting thing is that AMD profiling tool shows everything exclusively in Vulkan terms, nothing related to OpenGL.
I wonder whether they merely represent internal driver routines in Vulkan terms, or they internally convert OpenGL into Vulkan completely.
I've heard that Intel is converting OpenGL to Vulkan on recent drivers --- I guess that's the trend today.

Nvidia here... I lose about 5 to 15% performance with this change. Since the problem is with AMD on Windows, perhaps a shader branch for Linux in general ( AMD on Linux supposedly gets worse with this change too ) ? Not too catastrophic but is gonna be a little tough to explain in a 2.11 release article. It would be cool to know what happens on Nvidia + Windows though...

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

7 hours ago, stgatilov said:

I find it hard to believe that this change could have made anything worse.
And no, it is not possible to maintain both cases.

If you have problems, please report performance in 8 cases:

  • r_useNewBackend 1 and 0
  • Stencil and Maps
  • Hard and Soft

Since I just played Written in Stone and it has great detail I'll use it as a benchmark too, player start position and rotation.

464569487_written(2022-12-1216-15-31)(1414-1660216.25).thumb.jpg.92dab6dd49d8bf9e6db13ca7f7253bb4.jpg1615856886_written(2022-12-1216-18-25)(1414-1660182.25).thumb.jpg.345d00704a0a6884d570f428382efabf.jpg

The performance degradation here is insane: 111 FPS on 2.11 Beta 2 engine, 25 FPS on SVN 10211 engine. Exact same Darkmod.conf or a fresh one same thing, simply using the different binary makes this difference.

Tried all of the switches you mentioned and more, can't find anything that will bring the FPS back up. Only immediate thing I can think of is going through all the r_skip cvars in order again and see if any makes a difference.

Link to comment
Share on other sites

I believe @stgatilov was asking that you provide comparisons of the basics:

1) Hard Stencil beta vs svn

2) Hard Maps beta vs svn

3) Soft Stencil beta vs svn

4) Soft Maps beta vs svn

That should triangulate the affected area.

On review of the code change, in theory it "should" perform much better since the blur operations are done on the GPU (thus freeing the CPU for other work) but I guess there may be a pathological GPU pattern that looks good on paper but the hardware or compiler doesn't execute well.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

21 minutes ago, nbohr1more said:

I believe @stgatilov was asking that you provide comparisons of the basics:

1) Hard Stencil beta vs svn

2) Hard Maps beta vs svn

3) Soft Stencil beta vs svn

4) Soft Maps beta vs svn

That should triangulate the affected area.

On review of the code change, in theory it "should" perform much better since the blur operations are done on the GPU (thus freeing the CPU for other work) but I guess there may be a pathological GPU pattern that looks good on paper but the hardware or compiler doesn't execute well.

Sorry about that, will do this next. I just tested every r_skip one by one, zero difference. Even setting r_fboResolution to 0.25 doesn't increase it by a single FPS which is very strange.

Here are the average results with shadow quality set to Very High (r_softShadowsQuality 48) for maximum impact, map Written at the player start position and angle:

2.11 Beta 2, stencil & soft shadows: 105 FPS
2.11 Beta 2, stencil & hard shadows: 105 FPS
2.11 Beta 2, maps & soft shadows: 80 FPS
2.11 Beta 2, maps & hard shadows: 90 FPS
10211, stencil & soft shadows: 25 FPS
10211, stencil & hard shadows: 25 FPS
10211, maps & soft shadows: 25 FPS
10211, maps & hard shadows: 25 FPS

Worth noting: If I look away and into the ground while staying at the same position, it will jump back to some 100 FPS. The max 144 FPS is still achieved in the main menu so there's no hard cap.

Edited by MirceaKitsune
  • Like 1
Link to comment
Share on other sites

I am sure that the glprogs folder takes precedence but if you want another point of confirmation please try unpacking the tdm_base01.pk4 then overwrite the glprogs folder inside it and repack to see whether things improve.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

10 minutes ago, nbohr1more said:

I am sure that the glprogs folder takes precedence but if you want another point of confirmation please try unpacking the tdm_base01.pk4 then overwrite the glprogs folder inside it and repack to see whether things improve.

I'd be surprised too, but just to be extra sure I tried it: Repacked tdm_base01.pk4 with the glprogs directory replaced by the SVN generated one. Same thing with that, whether I also keep the same glprogs folder in the core TDM directory or remove it.

I compile the engine without any special parameters and used "make clean" first. My scripts in a nutshell:

mkdir foo/bar/engine/build
cd foo/bar/engine/build
cmake foo/bar/engine
make

 

Link to comment
Share on other sites

25 minutes ago, nbohr1more said:

I am sure that the glprogs folder takes precedence but if you want another point of confirmation please try unpacking the tdm_base01.pk4 then overwrite the glprogs folder inside it and repack to see whether things improve.

You can just open the pk4 with 7zip and delete the glprogs folder inside it.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

@MirceaKitsune Here's how I compile on Pop OS 22.04 (Ubuntu 22.04). Something to compare against. Maybe it will help?

$ sudo apt install \
    udev \
    build-essential \
    cmake \
    libsdl2-dev \
    libopenal-dev \
    libvorbis-dev \
    mesa-common-dev \
    libxxf86vm-dev \
    libxext-dev

$ cd ~/code

$ ls
darkmod_src/

$ mkdir build darkmod

$ ls
build/
darkmod/
darkmod_src/

$ cd build

$ cmake -DCMAKE_BUILD_TYPE='Release' ../darkmod_src

$ make -j$(nproc)

$ cd ../darkmod

$ ls
glprogs/
thedarkmod.x64
thedarkmod.x64.debug

To clean:

rm -r build darkmod

 

Edited by Daft Mugi
  • Like 1
Link to comment
Share on other sites

2 hours ago, MirceaKitsune said:

I compile the engine without any special parameters and used "make clean" first. My scripts in a nutshell:

mkdir foo/bar/engine/build
cd foo/bar/engine/build
cmake foo/bar/engine
make

 

Perhaps you should add -DCMAKE_BUILD_TYPE="Release", since it is not clear whether build would be optimized or not otherwise.

Also, you can try Tracy profiler to record a performance profile.
Set "com_enableTracing 1", then download Tracy viewer of appropriate version.
More details on wiki page.

With Tracy, you can see a lot of things immediately, e.g. whether it is GPU or CPU which is slow, which parts are slow, etc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...