Closed EmDash00 closed 4 weeks ago
Thanks for the hint. Which output device did you use?
If you're on macOS, pls try GKS_WSTYPE=gksqt python3 ...
I'm on Ubuntu 20.04.6 Linux. Here's some system info:
❯ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Stepping: 10
CPU MHz: 799.968
CPU max MHz: 4000.0000
CPU min MHz: 400.0000
BogoMIPS: 3999.93
Virtualization: VT-x
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 1 MiB
L3 cache: 8 MiB
NUMA node0 CPU(s): 0-7
Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Mitigation; Microcode
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse s
se2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtop
ology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16
xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm a
bm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority e
pt vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt inte
l_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_cl
ear flush_l1d arch_capabilities
❯ sudo lshw -C display
*-display
description: VGA compatible controller
product: UHD Graphics 620
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
logical name: /dev/fb0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
configuration: depth=32 driver=i915 latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
resources: iomemory:2f0-2ef iomemory:2f0-2ef irq:145 memory:2ffa000000-2ffaffffff memory:2fa0000000-2fafffffff ioport:3000(size=64) memory:c0000-dffff
I was using the default output device. Since I'm using python I simply modified the environment variable using os.environ["GKS_WSTYPE"] = "gksqt"
This appears to improve performance; however, I am still getting spikes. Here's a histogram of the time spent in gr.updatews()
Here's some more profiling and investigation. All the following plots run it for 60 seconds using dt = 0.04
Before:
Mean: 0.0078156736655206, std: 0.013422327717545259
After:
Mean: 0.006298769808211356, std: 0.01115415612618402
From the histograms we can see there's a fairly good improvement in framerate consistency. Would love it if we can get a stable 60 FPS. My computer uses integrated graphics as you can see and is a 5 year old laptop at this point.
We'll eventually be running this on a much more powerful desktop and was curious if I'm being limited by hardware. Decided to check running this on the desktop and got much more consistent timing.
dt = 0.01
Mean: 0.00024122460769211617, std: 0.0013291644913593795
The desktop has an Intel Core i7-7700 and Nvidia GTX 1070. It's possible that the integrated graphics are the bottleneck. Though the computer frequently renders much more complex scenes just fine so it's possible it's some implementation bottleneck is keeping it from performing as well as it usually does in other tasks. I didn't think it should experience throttling rendering a few lines and ### circles.
Would be curious as to what your thoughts are.
@jheinen Any updates?
I've been trying to use GR as an interactive visualization tool for a game experimental subjects will play; however, framerate consistency does appear to be an issue. I'm using Python GR; however, it appears that this is an issue with GR itself. Is there a way to make them more consistent?
Below is an example of the time it takes to call
gr.updatews()
with the double pendulum example. As you can see every few calls, we can see the amount of time it takes to callgr.updatews()
spikes. I'm wondering what exactly causes this and if anything can be done about it.Interestingly if we reduce the frequency with which we call
gr.updatews()
this framerate consistency vanishes.Here's the code I'm using for profiling: