Any idea why a GLFW3 build runs slow on these PCs?

Monkey Targets Forums/Desktop/Any idea why a GLFW3 build runs slow on these PCs?

Soap(Posted 2015) [#1]
We have a game where it seems to run fine on most computers, but not on some. Here are sample computer specs where it runs much lower FPS than what should happen.

1:
NVidia GeForce GTX 760 2GB GDDR5 OC
ASUS SABERTOOTH 990FX Rv2.0 MotherBoard.
AMD FX - 8 Core x @3,5GHz CPU.
CORSAIR Vengeance 8 GB - 1600MHz DDR3 RAM.
MAD CATZ Cyborg V.3 - 3200dpi Mouse.
Windows 7 x64 Ultimate

2:
Motherboard: Gigabyte P35C-DS3R (Intel P35)
CPU : Intel(R) Core(TM) 2Quad E9650 @ 3.01 GHz
Grafik: GigaByte GeForce GTX 670 OC 2GB (347.52)
Monitor: BenQ XL2420T @ 1920x1080
Sound: Creative Soundblaster X-FI Xtreme Gamer
Headset: Logitech G35
Mouse: Logitech G500[/b]
Keyboard: Logitech G19/G13
RAM: 2x 4GB G.Skill Ripjaws DDR3-1333 (9-9-9-24)
SSD: ADATA Premier Pro SP900 128 GB
HDD: Seagate Barracuda 3TB
PSU: Enermax EMG700AWT Modu87+
OS: Windows 7 Ultimate 64-Bit

3:
Windows 8.1
Processor: Intel(R) Core(TM) i5-3330 CPU @ 3.00GHz 3.00 GHz
Ram: 8.00 GB (7.87 usable)
System type: 64-bit OS, x64-based processor
Graphics Card: NVIDIA GeForce GT 620


dawlane(Posted 2015) [#2]
Hardware is not the only cause of an application running slow. Processes running in the background can also affect, as can not blowing the dust out of the machine. It has also been reported with a game not locking the frame rate to something reasonable causing problems with overheating GPU's.


Soap(Posted 2015) [#3]
We setupdaterate / timing to 60.

It may be other software. Hoping to find what is in common that would really matter.


dawlane(Posted 2015) [#4]
I see the one thing that they all have in common (apart from running MS Windows) is Nvidia cards. I would be looking to see what hardware drivers are being used and if there are any known issues with certain drivers or vendor cards. You should also enquire on the other hardware drivers as well. I have found BFG ones to be problematic in the past.
One Windows service that I found annoying was the bloody useless search. It's the first thing I turn off. It's not so bad if you have one hard drive with little on it, but when you have a few 2TB nearly full and have to do a reinstall, then it turns into a pain.


Nobuyuki(Posted 2015) [#5]
I also have these issues sometimes. Perhaps it's a bad interaction with other apps at the driver level or something ? My card's a GTX 750, manufacturer is EVGA (though that shouldn't matter, since nVidia provides the drivers for all vendors). Though it may not be related, I also have input lag from another hardware-accelerated application using openGL, ClipStudio Paint. It seems that when one app has the lag issues, the other does as well.


Neuro(Posted 2015) [#6]
I had weird issues like that sometimes. Its odd that when i run it on a VM, it actually runs faster as if the Intel graphic's chip is more efficient than an NVidia graphics card.


Simon S(Posted 2015) [#7]
Hi, thought I'd bump this issue. Also, first forum post. Hello everyone!

Anyway, I've had the exact same issue as Neuro. I'm running an Nvidia GTX 970 in 64 bit Windows 7.

I tried the Monkey X free demo first. Glfw2 ran beautifully. I could easily move a thousand 64x64 images with all transformations (colour, alpha, scale ect...) at 60fps. I was impressed enough to buy the full version of Monkey based on that trial.

However I see Glfw3 was the only option in the full version. The same code that ran at 60fps under Glfw2 ran about 5-10fps under Glfw3, even when reduced to a single object.

As an attempted fix I updated to the latest graphics drivers, ran a few benchmarks, checked if Windows was misbehaving (Task manager showed 0-2% CPU use when idle so no). Started up Monkey again, it still ran at a horrible 5fps with a single 64x64 sprite in Glfw3. Even the Amiga 500 could beat that. Checked my CPU and graphics card during run time, neither was particularly busy so it wasn't the machine bottlenecking.

So, based on this topic,
http://www.monkey-x.com/Community/posts.php?topic=4596
I plugged in my XBOX 360 pad. No difference. Reset my PC with the pad plugged in, suddenly it's great again. In fact it's even faster than Glfw2 ever ran.

So I think that linked topic is onto something worth looking into as this bug gave me an awful first impression of the full Monkey X language and I think other coders would feel the same in that circumstance.

It's good I've got a workaround, but it would be frustrating knowing a program I wrote would run at 5ps for unlucky Nvidia users who ever dared to use a joypad on their machine.

Weird, weird bug, but I'm impressed with Monkey X now I've seen the full version running at full speed.

Keep up the good work Blitz Research.


skid(Posted 2015) [#8]
It does look like the GLFW implementation of PollJoysticks is the issue.

Checking if a joystick is present is typically a synchronous call on PC - on BlitzMax calling JoyCount is not something you should call from your game's main loop as it was very slow and would be something you called only once if possible.

I suspect any legacy driver for the 15 pin joy port that worked with old analog joysticks will behave like this, as the only way to detect a joystick is plugged in is to use the time the potentiometers take to charge a capacitor (a synchronous operation that has to time out if the joystick is not even plugged in).

Unfortunately in Monkey it is out of your hands as joystick detection code is inside the polling code (BBGlfwGame::PollJoystick) and you are at the mercy of legacy and third party drivers .


Soap(Posted 2015) [#9]
I forgot to say before... but I remember one user saying when they unplugged a gamepad it made the game run faster.


Nobuyuki(Posted 2015) [#10]
Wow, this looks like cause for filing a bug report.


Neuro(Posted 2015) [#11]
Well the joystick trick didn't quite work for me. Its all random mostly. Any other ideas for this?


Neuro(Posted 2015) [#12]
Ok! Well looks like the last update Monkey v86a has fixed this issue for me. Anyone else noticed the change?