Performance issue with simple scene

Problems building or running the engine, queries about how to use features etc.
Post Reply
Ternvein
Gnoblar
Posts: 2
Joined: Thu Dec 14, 2017 8:15 am

Performance issue with simple scene

Post by Ternvein »

Ogre Version: 1.11.1, 1.10.11
Operating System: Arch Linux x86_64
Render System: OpenGL, OpenGL3+
Scene: empty. That means no entities are present, only scene nodes. I disabled all entities for this test.
Event manager: SDL2.0

Hello everybody. It's my first post on this forum, though I started using Ogre about a year ago, maybe more. But now I've encountered an issue I wasn't able to solve myself yet.

Issue: When I run my application on notebook with GeForce920M on board, I have performance drop to 2-4 FPS :!: When I run the same application on my desktop (some old Radeon video, I'll check the model tomorrow), I have a few thousands FPS. I thought that was a driver issue, but SampleBrowser works fine on both machines. So, I assume it's some initialization problem in my code. I checked my code against ApplicationContext initialization and was unable to find the reason. But a few days back I've noticed another strange behavior: FPS drop occurs only when my browser (vivaldi-1.14.1077.60) is open. This means that two seemingly independent applications affect each other in some way. I suspect OpenGL context problem, but have no clue what and where to look for. And still SampleBrowser works fine, and all other OpenGL applications either, regardless of browser, are running.

What is done: I completely freed the scene. No objects are actually rendering. Tried to disable SDL_PollEvents, but this makes things even worse (responsiveness of application drops, I think because render thread never actually "sleeps" in a poll). Updated Ogre to 1.11.1, without any noticeable difference in performance. Switched render system to OpenGL and back to OpenGL3+ again.

I thought that maybe someone encountered this issue or have some clue about what can go wrong. Thank you in advance.

EDIT: Forgot to mention, if I make

Code: Select all

RenderTarget::setActive(false)
on my render window (for example on focus lost), FPS goes back to 65000+. Maybe it seems obvious, but I already starting to double-check every possible reasons.

Best regards,
Ternvein.
Ternvein
Gnoblar
Posts: 2
Joined: Thu Dec 14, 2017 8:15 am

Re: Performance issue with simple scene

Post by Ternvein »

It seems I've found the solution, at least for now I can't reproduce this problem again.
Solution: It's quite stupid, really, and I can't imagine how I didn't think about it in a first place. The problem was in a frame limiting, actually absence of frame limiting. Somehow with open-source Radeon driver for Linux, framerate were limited to 60 FPS, probably in OpenGL implementation or somewhere down there. So on my desktop everything was fine with such low FPS. But on my notebook with NVidia there's no such limiting and my app throwed tons of requests at Xorg server, which led to 100% CPU usage by both Xorg and my application (I didn't notice that Xorg was on top too). It's kind of strange, because I have "direct rendering: Yes" in glxinfo, so I have no clue why OpenGL rendering is pinging Xorg on each frame. But limiting framerate to 60 FPS seems to fix the problem for now.
Post Reply