protonscr

csgo takes a long time to start with beta steam client, ok with stable client

steamclosed NVIDIA drivers
ValveSoftware/steam-for-linux#5116 · opened 2017-08-06 by af7567 · updated 2017-10-12 · 9 comments · github
Aaf7567 2017-08-06 github

Your system information

  • Steam client version (build number or date): beta up to date 06-08-2017
  • Distribution (e.g. Ubuntu): slackware64-current
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes
    Tested with nvidia drivers 384.59, 375.82, 381.22, 375.66 with the same results

Please describe your issue in as much detail as possible:

With the beta steam client, csgo is taking a long time to start every time, just showing a black screen for ages. With the stable client it can take a while the first time but once stuff is cached it starts a lot faster. Map loading times don't seem to be affected, just the game startup.

With the stable client the start time is about 17secs to get to the main menu, then 1-2secs for the main menu background and stuff to load.
With the beta client it takes 1m25secs - 1m30s to get to the main menu then another 15secs until the rest of the stuff is loaded.
These times are after the game has already been started once, so some data is cached.

I tried using strace to see what is going on and it is a lot of

[pid  5899] sched_yield()               = 0
[pid  5899] sched_yield()               = 0
[pid  5899] sched_yield()               = 0
[pid  5899] sched_yield()               = 0
[pid  5909] <... nanosleep resumed> NULL) = 0
[pid  5899] sched_yield( <unfinished ...>
[pid  5909] nanosleep({tv_sec=0, tv_nsec=1000000},  <unfinished ...>
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5899] sched_yield()               = 0
[pid  5899] sched_yield()               = 0
[pid  5899] sched_yield()               = 0

a bit of

[pid  5899] sched_yield( <unfinished ...>
[pid  5903] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5903] futex(0x1189160, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid  5899] sched_yield( <unfinished ...>
[pid  5909] <... nanosleep resumed> NULL) = 0
[pid  5903] <... futex resumed> )       = 0
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5909] nanosleep({tv_sec=0, tv_nsec=1000000},  <unfinished ...>
[pid  5903] futex(0x11955c0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1501980965, tv_nsec=985283000}, 0xffffffff <unfinished ...>
[pid  5899] sched_yield( <unfinished ...>
[pid  5903] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5903] futex(0x1195570, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid  5899] sched_yield( <unfinished ...>
[pid  5903] <... futex resumed> )       = 0
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5903] futex(0x11953a8, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1501980965, tv_nsec=985411000}, 0xffffffff <unfinished ...>
[pid  5899] sched_yield()               = 0
[pid  5903] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid  5899] sched_yield( <unfinished ...>
[pid  5903] futex(0x1195358, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5903] <... futex resumed> )       = 0
[pid  5899] sched_yield( <unfinished ...>

and sometimes

[pid  5899] sched_yield()               = 0
[pid  5904] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid  5899] sched_yield( <unfinished ...>
[pid  5904] <... clock_gettime resumed> {tv_sec=2574, tv_nsec=750055978}) = 0
[pid  5899] <... sched_yield resumed> ) = 0
[pid  5904] futex(0x11ca178, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1501980966, tv_nsec=364896000}, 0xffffffff <unfinished ...>
[pid  5899] clock_gettime(CLOCK_MONOTONIC, {tv_sec=2574, tv_nsec=750119091}) = 0
[pid  5899] access("/home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/platform/shaders/fxc/character_vs30.vcs", F_OK) = 0
[pid  5899] openat(AT_FDCWD, "/home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/platform/shaders/fxc/character_vs30.vcs", O_RDONLY) = 54
[pid  5899] access("/home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/platform/shaders/fxc/character_vs30.vcs", F_OK) = 0
[pid  5899] stat("/home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/platform/shaders/fxc/character_vs30.vcs",  <unfinished ...>
[pid  5909] <... nanosleep resumed> NULL) = 0
[pid  5899] <... stat resumed> {st_mode=S_IFREG|0755, st_size=18006, ...}) = 0
[pid  5909] nanosleep({tv_sec=0, tv_nsec=1000000},  <unfinished ...>
[pid  5899] fstat(54, {st_mode=S_IFREG|0755, st_size=18006, ...}) = 0
[pid  5899] lseek(54, 4096, SEEK_SET)   = 4096
[pid  5899] read(54, "L\372\22\240\372\"\337&\343y5\277\246\233</\354\263B\335\353[\337\266|\270xQ\310\216H\371\343.\206\"\20\34\n\34\314\376\217\230\220\26a\16\320NB\205\206\225\221aB\220\nz\255AWX\21\243\305\313\345j\6\273\343\321\265\36\260\340'J+M\215a\336\331\216\24\35\275\266\206\177\"Iw\n\34\254"..., 2902) = 2902
[pid  5899] read(54, "\2\7\0@LZMA\270\365\1\0\361\6\0\0]\0\0\4\0\0\0h\245^\324\202?\354faBk\217\223\3513\10Ug$\214P\221\37\0172\204j\347.\6\v\361\262\310\226+\210t\226\330zN\245J-*\225\332v\226\353~`\227\201\365\223\316J\323\r\251\262\200\347\374e\7\373\240\20\207[\360a\252"..., 4096) = 4096
[pid  5909] <... nanosleep resumed> NULL) = 0
[pid  5909] nanosleep({tv_sec=0, tv_nsec=1000000},  <unfinished ...>
[pid  5899] clock_gettime(CLOCK_MONOTONIC, {tv_sec=2574, tv_nsec=752232636}) = 0
[pid  5899] futex(0x11ca178, FUTEX_WAKE_PRIVATE, 2147483647 <unfinished ...>
[pid  5904] <... futex resumed> )       = 0
[pid  5899] <... futex resumed> )       = 1
[pid  5904] futex(0x1277108, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid  5899] futex(0x1277108, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid  5904] <... futex resumed> )       = -1 EAGAIN (Resource temporarily unavailable)

The strace output from launch to main menu is 400MB big so too big to upload here.

gdb gives this if I attach to the csgo process

warning: Could not load shared library symbols for bin/linux64/launcher_client.so.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f02d2334f07 in sched_yield () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f02d2334f07 in sched_yield () from /lib64/libc.so.6
#1  0x00007f02cb71490b in ?? () from /usr/lib64/libGLX_nvidia.so.0
#2  0x00007f02ca431509 in ?? () from /usr/lib64/libnvidia-glcore.so.375.66
#3  0x00007f02ce0a8751 in ?? () from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/libtogl_client.so
#4  0x00007f02ce098de3 in ?? () from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/libtogl_client.so
#5  0x00007f02ce08c05c in IDirect3DDevice9::CreateVertexShader(unsigned int const*, IDirect3DVertexShader9**, char const*, char*) ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/libtogl_client.so
#6  0x00007f02bf42a183 in ?? ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/shaderapidx9_client.so
#7  0x00007f02bf42cb47 in ?? ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/shaderapidx9_client.so
#8  0x00007f02bf42d829 in ?? ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/shaderapidx9_client.so
#9  0x00007f02bf42dc86 in ?? ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/shaderapidx9_client.so
[#10](/issue/ValveSoftware/steam-for-linux/10) 0x00007f02bf42c449 in ?? ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/shaderapidx9_client.so
[#11](/issue/ValveSoftware/steam-for-linux/11) 0x00007f02bf42c60a in ?? ()
   from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/shaderapidx9_client.so
[#12](/issue/ValveSoftware/steam-for-linux/12) 0x00007f02c7ae511e in ?? () from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/engine_client.so
[#13](/issue/ValveSoftware/steam-for-linux/13) 0x00007f02c7ae63d0 in ?? () from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/engine_client.so
[#14](/issue/ValveSoftware/steam-for-linux/14) 0x00007f02c7a9d726 in ?? () from /home/adamf/.local/share/Steam/SteamApps/common/Counter-Strike Global Offensive/bin/linux64/engine_client.so
[#15](/issue/ValveSoftware/steam-for-linux/15) 0x00007f02cee97379 in ?? ()
[#16](/issue/ValveSoftware/steam-for-linux/16) 0x00007ffd6c5a62b0 in ?? ()
[#17](/issue/ValveSoftware/steam-for-linux/17) 0x0000000000000001 in ?? ()
[#18](/issue/ValveSoftware/steam-for-linux/18) 0x00007ffd6c5a60f0 in ?? ()
[#19](/issue/ValveSoftware/steam-for-linux/19) 0x00007f02cee97379 in ?? ()
[#20](/issue/ValveSoftware/steam-for-linux/20) 0x000000000000000b in ?? ()
[#21](/issue/ValveSoftware/steam-for-linux/21) 0x00007ffd6c5a64a8 in ?? ()
[#22](/issue/ValveSoftware/steam-for-linux/22) 0x00007ffd6c5a63c0 in ?? ()
[#23](/issue/ValveSoftware/steam-for-linux/23) 0x00007f02cee72f99 in ?? ()
[#24](/issue/ValveSoftware/steam-for-linux/24) 0x00007f02cf0b88b0 in ?? ()
[#25](/issue/ValveSoftware/steam-for-linux/25) 0x0000000002debd80 in ?? ()
[#26](/issue/ValveSoftware/steam-for-linux/26) 0x0000000000000010 in ?? ()
[#27](/issue/ValveSoftware/steam-for-linux/27) 0x000000000000000d in ?? ()
[#28](/issue/ValveSoftware/steam-for-linux/28) 0x0000000002debd80 in ?? ()
[#29](/issue/ValveSoftware/steam-for-linux/29) 0x00000000024fed00 in ?? ()
[#30](/issue/ValveSoftware/steam-for-linux/30) 0x0000000000000020 in ?? ()
[#31](/issue/ValveSoftware/steam-for-linux/31) 0x00007f0200000012 in ?? ()
[#32](/issue/ValveSoftware/steam-for-linux/32) 0x00000000024fed00 in ?? ()
[#33](/issue/ValveSoftware/steam-for-linux/33) 0x0000000000000000 in ?? ()

I get a similar backtrace every time I let it continue then break again during startup

Aaf7567 2017-09-08 github

Still having this problem and almost got banned again because of it so decided to try and find a fix.
The functions CreatePixelShader and CreateVertexShader seem to be causing the problem and making csgo take 2mins or more to start every time. I remembered about some shader update in a recent version of steam client so looked for the changelog and found that I could do

STEAM_ENABLE_SHADER_CACHE_MANAGEMENT=0

With that variable set to 0 csgo starts up in about 20 secs again.
I am currently using nvidia driver 384.69

Aaf7567 2017-09-08 github

I deleted the shadercache directory and tested again with shader cache management enabled but it still takes a long time to start. It did recreate ~/.local/share/Steam/SteamApps/shadercache/730/nvidiav1/ but the directory remains empty even after the games has been running for a few minutes.

?ghost 2017-10-11 github

I have had the same issue with another game - XCOM2, which started only after I purchased the "War of the Chosen" expansion.
This expansion adds a loading screen with a progressbar, which always took 3-4 minutes to go through on my computer. I thought this was normal, until I read in some review article that only the first run should be this slow. This was fixed after Feral support suggested using "steamapps" folder name for my game library instead of "SteamApps". They suggested that I rename the folder, and readd it as game library in Steam.

To test this without having to readd the library, I simply created a symbolic link "steamapps" pointing to "SteamApps", right next to it in ~/.local/share/Steam. And voila, on the second run, the loading screen was done within seconds!

Afterwards, I deleted the symlink and verified that subsequent game starts are slow again, which they of course were. Then I restarted Steam with the abovementioned STEAM_ENABLE_SHADER_CACHE_MANAGEMENT=0 (and the symlink still deleted), which also caused the loading screen to finish quickly on second and any subsequent game start.

I am using GeForce GTX 970 card with nvidia drivers 375.82.

PPlagman 2017-10-11 github

This should actually already be fixed in the Beta client, we fixed a problem where older libraries that still had the SteamApps name would accidentally disable the shader cache. This client will be released sometime soon, so you can either switch to the Beta or wait for it to be released to confirm that it fixes these symptoms for you.

Aaf7567 2017-10-11 github

I just tried again without STEAM_ENABLE_SHADER_CACHE_MANAGEMENT=0 and csgo still takes a long time to start and load the menus for me. My games are in SteamApps and the shadercache directory remains almost empty, apart from creating 730/nvidiav1.

I created a link from steamapps to my SteamApps now and my shadercache is getting populated. It took a very long time to start still first time (since it was creating the cache) but the second run it started in just under 20 secs like it did with STEAM_ENABLE_SHADER_CACHE_MANAGEMENT=0.

I am using steam beta version Oct 10 2017, at 17:44:37

Should I just rename SteamApps to steamapps? :)

PPlagman 2017-10-12 github

Thanks for confirming it doesn't fix it, I will take a closer look.

PPlagman 2017-10-12 github

Can you try on today's build?

Aaf7567 2017-10-12 github

I just deleted my steamapps symlink and the contents of shadercache and retried with beta client Oct 11 2017.
The first time I ran csgo it took about 2.5mins to start and another 20secs to finish drawing the menu. Inside my SteamApps/shadercache the 730/nvidiav1 directory was created but it was empty.
The second time I ran csgo it took 2.5mins again, but this time the GLCache directory was created and populated.
The third time I ran it took 20secs to get to the menu and finish drawing it.

I don't know why it didn't create the GLCache directory first time around, unless it was still using steamapps and after running it once it updated to SteamApps somewhere.

Kkisak-valve maintainer 2017-10-12 github

Thanks for retesting @af7567, closing as fixed.

Nothing extracted yet.