You are not logged in.

#1 2021-05-03 13:53:40

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Poor Steam game performance (not OpenGL vs DX11) compared Windows

Do read the full post, some key info at the bottom!

I hadn't really realized beforehand, but after finishing making my system a dualboot with Windows yesterday I decided to play CS:GO, and was shocked to find that the performance was 50% more than on Arch Linux: 150 - 170 FPS compared to 240 - 250 FPS. I've seen online benchmark videos comparing the performance of Linux to Windows - including Arch Linux - in games, and in all of them I've seen OpenGL outperform DirectX by usually at least 10 - 20%. My question is, how could I solve my issue of poor OpenGL performance such that my system can be on par with other Arch Linux systems of the same hardware spec?

I am also using nvidia-dkms instead of nvidia or nvidia-lts, and I am running the latest LTS kernel.
Also running gnome-shell, latest release, with GDM as display manager.

My CPU: Ryzen 3 1200 (overclocked to 3.5 GHz from 3.1 GHz)
My GPU: NVIDIA GeForce GTX 1050 Ti
RAM: 16 GB DDR4-2400 (overclocked to 2933 MHz)
Storage: 1 TB 5900 RPM HDD + 2 TB 7200 RPM HDD
Motherboard: ASUS Prime B350M-A (non-CSM)

I'm not sure what commands you may request me to run and post the output of, so do request them in further replies.

glxinfo -B:

name of display: :1
display: :1  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 4096 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 3146 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 465.24.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 465.24.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 465.24.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

~/.xprofile

setxkbmap -layout gb
nvidia-settings -a :1/GPUPowerMizerMode=1
nvidia-settings -a :1/OpenGLImageSettings=0
nvidia-settings --load-config-only
pactl unload-module 6
export CLUTTER_VBLANK=none

The 2 nvidia-settings -a commands sets the GPU power mode to "Prefer Maximum Performance" and sets the OpenGL image quality to "High Quality" respectively.
I also have cpupower.service enabled, and have gotten it to set the CPU governor to "performance" upon boot - lscpu shows it to be working as my CPU is now constantly at around 3300+ MHz, but in OpenGL performance it has changed very little.

I do not have a xorg.conf, but however do have a xorg.conf.backup probably leftover from a previous xorg.conf that I probably removed in attempts to fix previous GDM display issues.

xorg.conf.backup:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 460.39

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"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Ancor Communications Inc VS248"
    HorizSync       30.0 - 83.0
    VertRefresh     50.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1050 Ti"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

One thing to note is that on Windows my Steam games - CS:GO included - are using launch options

-novid -fullscreen -nojoy

while on Arch Linux my launch options for my Steam games are the same as my Windows launch options but all have

__GL_THREADED_OPTIMIZATIONS=1 mesa_glthread=true vblank_mode=0 gamemoderun %command%

beforehand.

Last edited by Vectorlocity (2021-05-08 22:50:36)


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#2 2021-05-03 15:24:26

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Don't use GDM and certainly not gnome.
"startx xterm" and check the performance from there.

Offline

#3 2021-05-03 18:01:46

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

I can't seem to be able to focus into the CS:GO window in xterm.
Running xterm gives 3 oddly placed terminal windows with white backgrounds, like this: https://imgur.com/a/GHq5nXF
I can run Steam native from the command line, and I can run CS:GO from there.

However when CS:GO opens I cannot hear the main menu music (or anything), and the FPS is extremely low at a constant 15 FPS. My cursor stays as a cross - an X - and clicking anything and pressing any buttons does nothing. If I move my mouse around my FPS increases (?), and the more wildly I move my mouse around the more the FPS increases - with my FPS peaking at about 160 FPS doing so.

I don't exactly know what this means, and it probably shows that there is much more wrong with my system.

EDIT: Also, what's wrong with GDM and Gnome? I thought that they weren't particularly heavy - at least, XFCE is only a bit more lightweight.

Last edited by Vectorlocity (2021-05-03 18:54:50)


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#4 2021-05-03 18:45:27

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

GDM will cause 2 parallel display servers, itself uses GL, gnome is composited, X11 compositing isn't very efficient and it's another GL indirection.
On top of that, gnome comes w/ a lot of stuff™ that could easily generate sideload on the CPU or disk IO (eg. a file indexer) - there's a lot of stuff that can make things slow and if you're concerned about the GPU performance, you have to rule that out first.

Your startx experiences sound like you're running the regular session, but w/o any WM (defaults to twm…) and as user but not preserving the VT, causing a "broken" session where you lack device permissions (and also perhaps run on the VESA driver…)

You can use openbox to get a WM (what allows you to change focus in a traditional way) and please see https://wiki.archlinux.org/title/Xinit#Configuration (both xinitrc & xserverrc)

Offline

#5 2021-05-03 19:23:26

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Using "startx xterm" with OpenBox gives about the same FPS as with Gnome - I did some testing with Gnome today and averaged around 130 - 140 FPS, and in OpenBox I averaged around the same - so the issue isn't Gnome or the DE in use.

Some things to note are that CS:GO and other Source games tend to be more CPU-intensive than GPU-wise, and I've never ever seen any of my Source games fully utilize my CPU ever (as in 100% usage from top), so that could be something to bear in mind as well.


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#6 2021-05-03 19:40:35

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Using "startx xterm" with OpenBox

That's not a thing.
"startx xterm" will run xinit w/ xterm - not openbox.
And the sketch you posted suggests that xterm is installed so you can't have used some fallback xinitrc either.

nvidia-settings allows you to force the GPU into performance mode and nvidia-smi to watch its usage.

Offline

#7 2021-05-03 19:48:22

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

I did edit my xinitrc to change the final line to "exec openbox-session", and managed to focus onto windows as normal, as well as switch between them. I understand what the xterm part of the command means now.

As for monitoring my GPU, are you suggesting that I should put my GPU into "Prefer maximum performance" with Powermizer (which I have already done - part of my .xprofile) and monitor it's usage with nvidia-smi while CS:GO is running?

There's also another issue I forgot to put in the original post, albeit though it is much less significant and that it is CS:GO-exclusive - in that the skin textures for CS:GO in Arch Linux are much lower resolution than in Windows. I remember enabling negative LOD bias in the Windows NVIDIA Control Panel, however I don't know how to enable a negative LOD bias for OpenGL on Linux.

If you can't help with my smaller issue/want me to create a separate topic for it, that's fine. I'd prefer to focus on the main issue of the thread for now.


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#8 2021-05-04 11:13:11

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

monitor it's usage with nvidia-smi while CS:GO is running?

This one - does the GPU run at max capacity.
One more thing: steam uses vulkan, right?
Did you ensure it selects the nvidia backend?  - https://wiki.archlinux.org/title/Vulkan

A negative LOD (is that even allowed in MP?) will use high resolution textures for distant elements - not sure how this relates to "skin textures", but LOD bias isn't referenced in nvidias readme, so I guess it's not controllable at driver level.

Offline

#9 2021-05-04 18:03:55

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

nvidia-smi reveals 75 - 78% GPU usage while on the main menu, and 511 MiB VRAM use while also on main menu.
Without CS:GO running GPU usage sits at around 13 - 14%.
I've installed vulkan-icd-loader, and switched to the linux-zen kernel, and added "nouveau.blacklist=1" to my kernel launch parameters (EDIT: This didn't change much at all, the performance was very much the same).

I'm going to benchmark my system both in Windows and Linux using prime95, to see whether this really is an OpenGL specific issue.

EDIT: Have also removed the bulk of my launch options from my Steam games, leaving only "-novid -nojoy -console" for TF2 and CS:GO. The FPS didn't change much at all with it's remove, however adding my old launch options back decreases my CS:GO FPS down to 70 - 90.

EDIT: Benchmarked with Unigine Heaven instead, on Ultra settings with 8x MSAA: Arch Linux w/ OpenGL returned about 30 FPS average, and much did the same on Windows w/ DX11 (both Windows and Arch Linux were matched at 30 FPS).

EDIT: Looking at the scores of other users also using a GTX 1050 Ti on Unigine Heaven reveals my system is doing better than other ones - even ones with better CPUs (my score on OpenGL/Arch was 956, with other Windows users having Ryzen 5 1600's and getting 941 as their result). This leads me to believe it's an issue with Steam specifically on my Arch Linux installation.

EDIT: glxinfo shows direct rendering is enabled.

Last edited by Vectorlocity (2021-05-04 21:16:51)


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#10 2021-05-05 19:32:05

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Still haven't been able to fix the issue - I've tried reinstalling steam, removing CS:GO's steam directories entirely, but to no avail.
How do you make sure Vulkan selects the NVIDIA backend? I have nvidia-utils and lib32-nvidia-utils installed.


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#11 2021-05-05 20:41:25

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

https://wiki.archlinux.org/title/Steam#Fsync_patch
https://steamcommunity.com/app/410320/d … 219502826/

I've no personal experience w/ steam at all.
Is this steam from the arch repos or some flatpak installation?

Offline

#12 2021-05-05 21:38:04

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

I am currently attempting to regenerate my Steam folder, although this will mean moving over 500 GBs of files - not a wise choice by me as that will take a very long time.
In the meantime, I thought the linux-zen kernel included the fsync patch?

I will try the dxvk.conf idea, might work.

I am using Steam from the Arch repositories, yes.


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#13 2021-05-06 08:14:03

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

I thought the linux-zen kernel included the fsync patch?

Yup, lost track that you had already tried that.

Offline

#14 2021-05-06 20:21:57

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Alright, regenerating my steam folder did... very little.
As also did dxvk.conf.
I'm currently looking into optimizing CS:GO on just "Linux" - not specifically Arch Linux, to see where I can get.

EDIT: Alright, I'm pretty much back to where I started after decreasing my performance many times over.
This is my CS:GO config, if anyone can help:

// local server
sv_cheats "1"
sv_voiceenable "1"

// audio
snd_mix_async "1"
snd_mixahead "0.025"

// binds
alias "+jumpthrow" "+jump;-attack"
alias "-jumpthrow" "-jump"
bindToggle "v" "voice_enable"
bind "n" "noclip"
bind "alt" "+jumpthrow"

// voice
voice_enable 1
voice_caster_enable "1"
voice_scale "0.6"
voice_modenable "1"

// hud
cl_hud_color "8"
cl_showpos "0"
hud_scaling "0.8"

// viewmodel
viewmodel_presetpos "4"
viewmodel_fov "68"
cl_bob_lower_amt "5"
cl_bobamt_lat "0.1"
cl_bobamt_vert "0.1"
cl_bobcycle "0.1"
cl_viewmodel_shift_left_amt "0.5"
cl_viewmodel_shift_right_amt "0.25"
viewmodel_recoil "0"

// network + fps + ping info
net_graph "1"
net_graphproportionalfont "1"
net_graphheight "0"
net_graphpos "1"

// gameplay
cl_autowepswitch "0"
cl_radar_always_centered "0"

// community server options
cl_disablehtmlmotd "1"

// performance optimisations
cl_forcepreload "0"
sv_forcepreload "0"
mat_queue_mode "2"
fps_max "0"
cl_predict "1"
cl_predictweapons "1"
cl_autohelp "0"
cl_showhelp "0"
cl_lagcompensation "1"
r_drawtracers_firstperson "1"
cl_disablefreezecam "1"

// peripheral input
m_rawinput "1"
im_mousespeed "0"
joystick "0"

// crosshair
cl_crosshairalpha "255"
cl_crosshaircolor "5"
cl_crosshaircolor_r "255"
cl_crosshaircolor_g "0"
cl_crosshaircolor_b "255"
cl_crosshairdot "0"
cl_crosshairgap "-2"
cl_crosshairsize "3"
cl_crosshairstyle "4"
cl_crosshairusealpha "1"
cl_crosshairthickness "1"
cl_fixedcrosshairgap "0"
cl_crosshair_outlinethickness "1"
cl_crosshair_drawoutline "0"
cl_crosshair_sniper_width "1"

// network options
rate "786432"
cl_cmdrate "128"
cl_updaterate "128"
cl_interp "0"
cl_interp_ratio "1"
cl_lagcompensation "1"

// save to user csgo config.cfg
host_writeconfig

Last edited by Vectorlocity (2021-05-06 21:21:45)


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#15 2021-05-07 15:48:18

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

https://bbs.archlinux.org/viewtopic.php?id=264306

This fix looks promising, a reboot will tell me whether it works or not.


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#16 2021-05-07 16:11:15

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Spoiler: it wont. (It can't)

/etc/X11/xorg.conf.d/20-nvidia.conf

Section "Device"
    Identifier "Default nvidia Device"
    Driver	"nvidia"
    Option	"NoLogo"				"True"
    Option	"TripleBuffer"			"True"
…
EndSection

Offline

#17 2021-05-08 17:28:04

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

I don't have that file - do I need it, and what does it do?
I'm currently benchmarking everything all over again, because I'm not actually sure whether it is Steam or OpenGL in general.
Black Mesa on Windows gives about a 50% FPS boost with DX11 (50 FPS vs 90 FPS at worst, 90 FPS vs 180 FPS at best), but that doesn't narrow much down, but does provide confirmation that it isn't just CS:GO.

EDIT: Black Mesa's corroborating results could also mean that the issue isn't with just Steam games - but Source games specifically. I'll see how it goes.

Last edited by Vectorlocity (2021-05-08 17:49:54)


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#18 2021-05-08 17:47:19

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Benchmarking results have returned this:

Unigine Heaven (8x MSAA, ultra, 1920x1080 fullscreen):
        Windows + DX11: 871, 34.6 mean FPS, 7.9|55.2 min|max FPS
        Arch Linux + OpenGL: 907, 36.0 mean FPS, 18.4|58.6 min|max FPS

Geekbench 5 (CPU benchmark):
        Windows: 883|3121 single-core|multi-core
        Arch Linux: 947|3344 single-core|multi-core

GeekBench 5 (GPU compute benchmark):
        Windows: 20875|22923|21472 CUDA|OpenCL|Vulkan
        Arch Linux: 21167|23281|21672 CUDA|OpenCL|Vulkan

So this tells me essentially that my system overall is running faster on Arch Linux than Windows, and is narrowly overtaking DX11 with OpenGL (as it should) - so it is definitely an issue with my Steam games specifically.


I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

#19 2021-05-08 20:00:31

seth
Member
Registered: 2012-09-03
Posts: 20,462

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

You need to create the file (w/o the ellipsis!)
It'll enable triple buffering in the GPU, so if the problem is that steam or source awkwardly blocks for vblank signals, this will be mitigated.

Offline

#20 2021-05-09 03:32:00

Vectorlocity
Member
Registered: 2018-04-15
Posts: 128

Re: Poor Steam game performance (not OpenGL vs DX11) compared Windows

Black Mesa now gives 110 FPS instead of 90 FPS now on OpenGL - still less than 170 FPS on DX11, but you take what you get.
Not sure what I did to make it like that - perhaps it was my newly added launch options (which are also there for CS:GO, which is at 170 FPS compared to 240 FPS on DX11):

__GL_THREADED_OPTIMIZATIONS=1 mesa_glthread=true vblank_mode=0 gamemoderun %command% -nojoy -novid -gl_nv_bindless_texturing -gl_amd_pinned_memory -gl_enablesamplerobjects

I have two types of smile. A contented and genuinely joyful smile and a devious smile.

Offline

Board footer

Powered by FluxBB