Bumblebee-Project / Bumblebee

Bumblebee daemon and client rewritten in C
http://www.bumblebee-project.org/
GNU General Public License v3.0
1.29k stars 144 forks source link

Steam-CS Source stammers #389

Closed johanovic closed 11 years ago

johanovic commented 11 years ago

Hi folks,

Thanks for this great piece of software. For a few days now I have been trying to debug why counterstrike source stammers at random times when playing it.

I am getting this at test values:

GeForce GT 640M/PCIe/SSE2 ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. 344.561361 frames/sec - 384.530479 Mpixels/sec 386.634641 frames/sec - 381.417963 Mpixels/sec 400.356583 frames/sec - 389.309944 Mpixels/sec 400.216272 frames/sec - 389.173504 Mpixels/sec 400.893141 frames/sec - 389.831698 Mpixels/sec 399.242757 frames/sec - 388.226851 Mpixels/sec

In CS Source I get a fps of about 150, but it stammers. My bumblebee installation on Ubuntu 12.10 is by the book.

I ran the game both by adding 'vblank_mode=0 primusrun %command%" or by adding "primusrun %command%". The last one results in 60 fps.

http://steamcommunity.com/app/221410/discussions/5/846939854395048434/

Thanks in advance.

Any ideas?

ArchangeGabriel commented 11 years ago

If it runs ok with optirun, then this is a primus issue, that you are welcome to report on primus tracker.

amonakov commented 11 years ago

It was probably already fixed with https://github.com/amonakov/primus/commit/af8fa24f0e08d5cca19e4db2e51a5a86360fc9b8 (but Ubuntu packages have not been rebuilt)

johanovic commented 11 years ago

@ArchangeGabriel The problem also occurs with optirun.

amonakov commented 11 years ago

When the new primus builds arrive, try enabling/disabling multicore rendering and choose what works best.

johanovic commented 11 years ago

SC Source actually has an option to enable or disable multicore rendering.

amonakov commented 11 years ago

Did you mean "does not have"? (sorry, I presumed all Linux Source games have that option)

In any case, can you additionally tell us your CPU model, laptop model, nVidia drivers version, and show output of PRIMUS_VERBOSE=2 vblank_mode=0 primusrun glxspheres. I'm just curious because your stats shown in the opening post are quite good!

johanovic commented 11 years ago

Hi amonakov,

I meant "has an option". I messed with it, but it did not really help.

Here are the specs for the Lenovo Ideapad Z580. I am using Bumblebee-nvidia. In my case I think that is 304.88-ubuntu0.1.

processor : 0 (8 in total) vendor_id : GenuineIntel cpu family : 6 model : 58 model name : Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz stepping : 9 microcode : 0x12 cpu MHz : 2201.000 cache size : 6144 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms bogomips : 4389.80 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: (I use Granola set to the highest performance)

The results for PRIMUS_VERBOSE=2 vblank_mode=0 primusrun glxspheres Polygons in scene: 62464 ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. Visual ID of window: 0xae Context is Direct OpenGL Renderer: GeForce GT 640M/PCIe/SSE2 ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. 329.144434 frames/sec - 367.325188 Mpixels/sec 360.392036 frames/sec - 381.741780 Mpixels/sec primus: profiling: readback: 354.9 fps, 0.3% app, 99.6% map, 0.2% wait primus: profiling: display: 354.8 fps, 54.8% wait, 39.0% upload, 6.2% draw+swap 402.654974 frames/sec - 391.544918 Mpixels/sec 404.331878 frames/sec - 393.175553 Mpixels/sec primus: profiling: readback: 404.2 fps, 0.0% app, 99.9% map, 0.1% wait primus: profiling: display: 404.3 fps, 54.9% wait, 38.7% upload, 6.5% draw+swap 404.729476 frames/sec - 393.562180 Mpixels/sec 403.468833 frames/sec - 392.336321 Mpixels/sec 403.303411 frames/sec - 392.175463 Mpixels/sec primus: profiling: readback: 403.2 fps, 0.0% app, 99.9% map, 0.1% wait primus: profiling: display: 403.2 fps, 54.8% wait, 38.8% upload, 6.4% draw+swap 403.097316 frames/sec - 391.975055 Mpixels/sec 403.999278 frames/sec - 392.852130 Mpixels/sec primus: profiling: readback: 403.7 fps, 0.0% app, 99.9% map, 0.1% wait primus: profiling: display: 403.7 fps, 54.9% wait, 38.7% upload, 6.4% draw+swap 403.693835 frames/sec - 392.555114 Mpixels/sec 399.850663 frames/sec - 388.817983 Mpixels/sec

For comparison: my built-in intel GPU gives me 60 fps.

My problem with CS Source is not solved. It feels like playing like an epileptic (no offence intended! I don't know a better metaphor). It would be nice to get +300fps in that game. All suggestions are welcome.

When will the new primus ship for Ubuntu?

ArchangeGabriel commented 11 years ago

Primus has been updated on the PPA on monday. The new version is 2030422.

johanovic commented 11 years ago

I did the upgrade. Primusrun was broken but as amonakov told me in IRC, optirun -b primus works fine. The gameplay is not flawless, but it is fairly good (a lot better than before). With no vblank, I get 135 fps. It does overheat my laptop thought.

johanovic commented 11 years ago

The problem is not solved yet. I do not experience it on an external screen, though. Anything I can do?

ArchangeGabriel commented 11 years ago

Open a new issue on primus tracker if you're not seeing this problem with VirtualGL.

johanovic commented 11 years ago

The problem is both with primusrun and optirun.

amonakov commented 11 years ago

Are you saying that the update reduced stuttering, but it's still not ideal? Is it the same with multicore rendering enabled and disabled?

Show logs with PRIMUS_VERBOSE=2 primusrun

johanovic commented 11 years ago

The update reduced it on an external screen. On my laptop screen the stuttering is horrible. Unplayable. I messed with vertical syncing and with multicore rendering a lot with no result. You want me to run steam rather than CS:S with PRIMUS_VERBOSE=2 primusrun? That's likely to give a lot of overhead, not?

amonakov commented 11 years ago

Why does using the external screen make a difference? Have you disabled compositing?

Just prefix PRIMUS_VERBOSE=2 to primusrun when running CS:S.

amonakov commented 11 years ago

ValveSoftware/Source-1-Games/issues/113 looks relevant — possibly not our bug.

johanovic commented 11 years ago

I can confirm that this bug is not related to primus nor bumblebee. I am closing it.