You are not logged in.

#1 2017-11-04 21:17:38

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Weird behaviour on all games and other software using the GPU

Hi!

My PC seems to be using a lot of time randomly during one rendered frame of any software using a GPU. The frame takes roughly a 100ms to draw, and during that time the game clock (or PC? no idea) fast-forwards from 0.5 to serveral seconds, which can be seen as a huge jump in game or benchmark demo during that 100ms of frame time.

For example, when I play Dungeons 3, I move the camera with wasd, and when this hiccup happens, the camera warps immediately to somewhere where it would have been if I moved the camera for a second or three. Another example is when I run the Unigine benchmark, from time to time on one frame the fps drops to 9 - 9.5 and the camera jumps forward a lot during that hiccup. Also glxgears have randomly sometimes a lot fewer frames if I do not limit the FPS. Furmark shows that a frame takes sometimes up to 900ms, but I have never seen that long pause in rendering. The rendering continues always almost instantly (after ~100ms or so), not after almost a second. The image though jumps as if there was such long pause.

This is perfect to play some jumpscare games as they get more scary, but otherwise this is quite a bit frustrating, as it affects the gameplay a lot if the camera / FPS character all of sudden moves a lot.

I do not see any output in dmesg or journal that might relate to this. When I launch an application that uses GPU, journal is filled with lines that show me what displays are connected and what is the maximum used pixel clock for those displays. I am using the current nvidia driver (387.22-4) and I had this happen on versions 387.22-3, 387.12-2 and 387.12-1. GPU is GTX 1080 Ti. My CPU is i7-7820X (Skylake-X) and it is overclocked, but this happens regardless if the CPU overclocking is enabled or not. My RAM is 3200Mhz 14-14-14-34 with XMP, and it happens even if I turn the XMP profile off.

I have no further ideas. Anyone have any clue or additional ideas what I should be checking next?

Offline

#2 2017-11-06 13:30:23

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 5,691

Re: Weird behaviour on all games and other software using the GPU

memory and swap usage come to mind.

Something IO-intensive running in the background could also cause this.


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2017-11-07 07:10:47

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

I got 32gb of memory and it's nowhere near filled when this happens. I'm not sure though if something is using the swap though. How do I check IO operations if they cause this, which I really doubt as I don't think benchmarks are using IO at all while playing back the test.

A co-worker found this for me: https://communities.intel.com/thread/117546

I tried disabling turbo and giving more voltage to the CPU, but that did not help it. Before all that I updated my BIOS to the latest, as I noticed my BIOS version before shouldn't have supported my CPU. Problem still exists.

Offline

#4 2017-12-06 11:54:46

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

I noticed that I had not tested any Vulkan games or software, so I did just that. I tried using vkmark and I see no weird behaviour. It still happens on OpenGL applications with the newest drivers.

A friend of mine is guessing it's about how linux spreads cpu time for threads, but I'd say that's pretty far-fetched idea as I have no other load whatsoever when running the OpenGL benchmarks. I am still out of ideas on my own.

Offline

#5 2017-12-06 12:42:22

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 5,691

Re: Weird behaviour on all games and other software using the GPU

The WM/DE could also be the cause.

Have you tried running those benchmarks in their own x-server ?


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#6 2017-12-06 14:36:52

seth
Member
Registered: 2012-09-03
Posts: 4,994

Re: Weird behaviour on all games and other software using the GPU

Do you think you could make a video of this?
Does it also happen with ultra-light GL clients like glxgears?
Do you have a high frequency output (144Hz or so) or g-sync?
Is this an optimus system?
Does this maybe sync to ntp updates?

Offline

#7 2017-12-07 16:14:20

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

Lone_Wolf wrote:

Have you tried running those benchmarks in their own x-server ?

I tried this quickly, and wasn't able to run another xorg server because of this:

/usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server

Didn't have time to figure out why yet. Will look at it when I have some spare time.

seth wrote:

Do you think you could make a video of this?

I guess this is a possibility. I need to do some research of video recording. I'll make a video of it if it's easy enough, sure.

seth wrote:

Does it also happen with ultra-light GL clients like glxgears?

Yes.

seth wrote:

Do you have a high frequency output (144Hz or so) or g-sync?

No. I have two HP ZR24w monitors with 60Hz and 1920x1200 resolution.

seth wrote:

Is this an optimus system?

I don't think so, no. From the wiki page it looks to be about running two different GPUs at once. My only GPU in the system is my 1080Ti.

seth wrote:

Does this maybe sync to ntp updates?

I'm not sure how to check this. How I understand ntp though, is that it shouldn't make such jumps if the change is small enough. Instead it'll span the correction over some time, like minute or minutes. I may also be wrong about this so I'll check it out.

Thanks!

Offline

#8 2017-12-07 16:25:25

slithery
Member
Registered: 2013-12-01
Posts: 2,080

Re: Weird behaviour on all games and other software using the GPU

Lazzu wrote:
Lone_Wolf wrote:

Have you tried running those benchmarks in their own x-server ?

I tried this quickly, and wasn't able to run another xorg server because of this:

/usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server

Didn't have time to figure out why yet. Will look at it when I have some spare time.

You need to run this from a TTY, it won't work if you try launching from inside an existing X session.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan

aur - dotfiles

Offline

#9 2017-12-07 16:47:00

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

slithery wrote:

You need to run this from a TTY, it won't work if you try launching from inside an existing X session.

Ah, right. Of course. Thanks!

Offline

#10 2017-12-07 19:20:26

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

Lone_Wolf wrote:

Have you tried running those benchmarks in their own x-server ?

I did try this, and the glitch still happens.

seth wrote:

Do you think you could make a video of this?

I made a video: https://youtu.be/uk_IduqBZ2Q
It happens at about 0:19. Keep an eye on the FPS and Min FPS.

Offline

#11 2017-12-07 20:13:34

seth
Member
Registered: 2012-09-03
Posts: 4,994

Re: Weird behaviour on all games and other software using the GPU

It does not look like the rendering stalls at any moment. Rather as if some render buffer outperforms an output buffer and is then dropped when the queue is full.
What window manager is this? Is there any compositor running? Do you enforce the full composition pipeline (or trigger it inadvertently by eg. scaling the output)
Do you have triple buffering enabled in the nvidia driver? (Option "TripleBuffer" "true")? Does it make a difference?
Did you disable buffer flipping (checkbox in nvidia-settings)?

Offline

#12 2017-12-07 20:27:10

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

seth wrote:

It does not look like the rendering stalls at any moment. Rather as if some render buffer outperforms an output buffer and is then dropped when the queue is full.
What window manager is this? Is there any compositor running? Do you enforce the full composition pipeline (or trigger it inadvertently by eg. scaling the output)
Do you have triple buffering enabled in the nvidia driver? (Option "TripleBuffer" "true")? Does it make a difference?
Did you disable buffer flipping (checkbox in nvidia-settings)?

Yeah it does not look like it but other benchmarks (furmark as one) report hundreds of ms as frame time even though it clearly never takes that long to render the image.
I'm using Gnome 3 with default settings out of the box. Haven't touched composition settings, so it's using whatever comes by default with the DE package group.
Enabling triple buffering increases the average and max FPS quite a bit in the unigine-heaven benchmark with the same settings as in the video I recorded, but the hiccup still happens and FPS goes down to 9 occasionally.
Buffer flipping setting does not seem to have any effect.

Last edited by Lazzu (2017-12-07 20:28:02)

Offline

#13 2017-12-07 20:33:33

seth
Member
Registered: 2012-09-03
Posts: 4,994

Re: Weird behaviour on all games and other software using the GPU

=> Get mutter out of the way and try eg. openbox (though a dedicated X11 server should have done that, but anyway ...)

Offline

#14 2017-12-07 20:49:10

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

seth wrote:

=> Get mutter out of the way and try eg. openbox (though a dedicated X11 server should have done that, but anyway ...)

I tried with openbox and it still happens.

Also I was probably too hasty to say that it does not happen on Vulkan. I tried out this another benchmark and it does report frame times sometimes way past a second, with no visible animation glitches though.

Makes me really wonder about if there really is a clock problem with too long times being reported sometimes. I'll make up a fast piece of code to test it out.

Last edited by Lazzu (2017-12-07 20:50:58)

Offline

#15 2017-12-07 22:12:36

Lazzu
Member
Registered: 2012-10-27
Posts: 51

Re: Weird behaviour on all games and other software using the GPU

I tested with some WebGL benchmarks and confirm that it does the same thing there too. Isn't WebGL using GLES API or something? This benchmark for example occasionally drops to 10FPS which is consistent behaviour with the unigine-heaven benchmark.

I also wrote a small program that measures time of some random load. Never saw a spike there, so I'm guessing it's not the system clock doing some hiccuping, and is still purely connected to apps using the GPU.

Last edited by Lazzu (2017-12-07 22:13:15)

Offline

Board footer

Powered by FluxBB