Stuttering in Diablo III

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Sarithis
Newbie
Newbie
Posts: 2
Joined: Sun Apr 02, 2017 10:05 am

Stuttering in Diablo III

Post by Sarithis »

I searched far and wide for a solution, but I couldn't find a working one. This video shows what I'm talking about. I'm using nvidia 378.13-2 drivers. With my current settings, the stuttering doesn't occur in games which support Linux natively. I also can't see it while watching YouTube videos in Chrome. For some reason, it only happens in Diablo III when I run it with wine-staging. I guess it's a problem with open-GL vsync. Here are my configuration files and some additional info:

/etc/X11/xorg.conf

Code: Select all

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 378.13  (builduser@anthraxx)  Thu Feb 16 23:29:17 CET 2017

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 378.13  (buildmeister@swio-display-x86-rhel47-05)  Tue Feb  7 19:37:00 PST 2017

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Ancor Communications Inc ASUS PB238"
    HorizSync       24.0 - 83.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 770"
	Option		   "TripleBuffer" "True"
	Option  	   "Coolbits" "13"
	Option  	   "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefaultAC=0x1"
	Option		   "RegistryDwords" "OGL_MaxFramesAllowed=0x4; EnableBrightnessControl=1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
~/.config/compton.conf

Code: Select all

backend = "glx";
paint-on-overlay = true;
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "opengl-swc"; 
shadow = true;          # Enabled client-side shadows on windows.
no-dock-shadow = true;      # Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true;       # Don't draw shadows on DND windows.
clear-shadow = true;        # Zero the part of the shadow's mask behind the window (experimental).
shadow-radius = 7;      # The blur radius for shadows. (default 12)
shadow-offset-x = -7;       # The left offset for shadows. (default -15)
shadow-offset-y = -7;       # The top offset for shadows. (default -15)
shadow-exclude = [
 "! name~=''",
 "n:e:Notification",
 "n:e:Plank",
 "n:e:Docky",
 "g:e:Synapse",
 "g:e:Kupfer",
 "g:e:Conky",
 "n:w:*Firefox*",
 "n:w:*Chrome*",
 "n:w:*Chromium*",
 "class_g ?= 'Notify-osd'",
 "class_g ?= 'Cairo-dock'",
 "class_g ?= 'Xfce4-notifyd'",
 "class_g ?= 'Xfce4-power-manager'"
];
fading = true; # Fade windows during opacity changes.
fade-delta = 4; # The time between steps in a fade in milliseconds. (default 10).
fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
#no-fading-openclose = true; # Fade windows in/out when opening/closing

detect-client-opacity = true; # This prevents opacity being ignored for some apps. For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
wintypes:
{
  tooltip = { fade = true; shadow = false; };
};
Additional info:

Code: Select all

~ echo $__GL_SYNC_TO_VBLANK
0

~ echo $__GL_THREADED_OPTIMIZATIONS
1

~ sudo cpupower frequency-info                                                                                                                                                            00:04:19 
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 800 MHz - 4.00 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 800 MHz and 4.00 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: 4.00 GHz (asserted by call to hardware)
  boost state support:
    Supported: yes
    Active: yes

~ pacman -Q | grep 'nvidia\|wine'                                                                                                                                                         00:05:41 
lib32-nvidia-utils 378.13-3
nvidia-dkms 378.13-5
nvidia-settings 378.13-1
nvidia-utils 378.13-6
opencl-nvidia 378.13-6
wine-staging 2.3-1
winetricks 20170316-1
I also switched on the "Sync to VBLANK", "Allow Flipping" and "Use Conformant Texture Clamping" options in nvidia-settings. According to this tutorial it should work. And yet it doesn't... the stuttering still occurs.

My CPU: i7 4770k with turbo boost to 4.0Ghz
Average framerate in Diablo 3: 55-60 FPS
FPS drops during game / when stuttering occurs: None, it stays at 60 fps
Average CPU usage by 'Diablo III.exe': 140% (it utilises two threads)

What I already tried:
- Nouveau drivers: I couldn't even see if the stuttering was there because average FPS was oscillating around 15...
- Running the 64bit client with wine64: again, FPS suddenly dropped to 13-15
- Running the game with taskset -c 0, taskset -c 1 or taskset -c 2: it seemed that no matter what value I enter after the -c parameter, the game always used only one CPU core (CPU usage never exceeded 99%). It also caused a huge FPS drop (to like 3-4 FPS)

I'm out of ideas. I'd be greatful for any help from you guys.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Stuttering in Diablo III

Post by Bob Wya »

Sarithis wrote:

Code: Select all

...
~ pacman -Q | grep 'nvidia\|wine'                                                                                                                                                         00:05:41 
...
wine-staging 2.3-1
winetricks 20170316-1
...
@Sarithis,

This might be a regression from: wined3d-buffer_create: Update and reenable patch.
Certainly the original patch caused issues for a number of games...

Also have you tested Diablo III with CSMT enabled?

Probably would a good idea to try a regression test - Wine Staging version 2.1 is the first release - before the wined3d-buffer_create original function was commited.

Otherwise I'm not sure what to suggest - file a bug perhaps?
... Once you've done a regression test (if it is a regression/ you can find a performant older version of Wine Staging)...

Bob
Sarithis
Newbie
Newbie
Posts: 2
Joined: Sun Apr 02, 2017 10:05 am

Re: Stuttering in Diablo III

Post by Sarithis »

Bob Wya wrote: @Sarithis,

This might be a regression from: wined3d-buffer_create: Update and reenable patch.
Certainly the original patch caused issues for a number of games...

Also, have you tested Diablo III with CSMT enabled?

Probably would a good idea to try a regression test - Wine Staging version 2.1 is the first release - before the wined3d-buffer_create original function was commited.

Otherwise, I'm not sure what to suggest - file a bug perhaps?
... Once you've done a regression test (if it is a regression/ you can find a performant older version of Wine Staging)...

Bob
Thank you for answering Bob. I tried to run this game with CSMT enabled and disabled - it didn't make any difference. Here's what I did in order to install wine-staging 2.1:
- uninstalled my current wine package
- downloaded wine 2.1 and wine-staging 2.1
- unpacked both archives and applied all patches in ./wine-staging-2.1/patches to ./wine-2.1/
- compiled wine 2.1 and installed it

After that I removed ~/.wine and ran winecfg. Unfortunately, it didn't fix the problem - Diablo III was still stuttering.
quimbydogg
Newbie
Newbie
Posts: 1
Joined: Sat Apr 08, 2017 7:59 am

Re: Stuttering in Diablo III

Post by quimbydogg »

I've been fighting with the stuttering on Diablo 3 the last few weeks as well. Tried all sorts of versions of wine, nvidia drivers, and kernels but didn't seem to have an impact. Game will regularly be running at over 100 FPS and then dive down to 30 and lower. Stutters happen very frequently - enough that the game is unplayable. The last time I played Diablo 3 on linux with wine was a few years ago but I remember it being nearly flawless at that time.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Stuttering in Diablo III

Post by Bob Wya »

quimbydogg wrote:I've been fighting with the stuttering on Diablo 3 the last few weeks as well. Tried all sorts of versions of wine, nvidia drivers, and kernels but didn't seem to have an impact. Game will regularly be running at over 100 FPS and then dive down to 30 and lower. Stutters happen very frequently - enough that the game is unplayable. The last time I played Diablo 3 on linux with wine was a few years ago but I remember it being nearly flawless at that time.
That's not a good situation really... bummer... :cry:

I'd suggest that one of you guys files a bug...

If the game used to work - with less of the massive frame drops - then it would be super helpful if one of you could do a regression test. I don't own the game - so I can't do this job myself.
The Wine Git log will give you an idea how far back you have to test (every release is date-stamped).

The only problem with regression testing is the every increasing number of patches you would need to backport to get old versions of Wine to build against newer system libraries...
On the hand if you want your bug report to languish on the WineHQ Bugzilla, without a response... :wink:

I've got Wine (Staging) versions building back to version 1.8 - in my Gentoo Overlay - that's quite easy...
But it's ever increasingly hard work to go back further than that...

Bob
Locked