When running glxgears (or any graphically intensive application) on linux I see 100% utilization of a single cpu core, even though I've confirmed it is using my Nvidia GPU as the renderer. Is that expected?

My Machine

$ inxi -Fxz
System:    Kernel: 4.15.0-38-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.6 (Gtk 3.18.9) Distro: Linux Mint 18.2 Sonya
Machine:   System: Dell (portable) product: Precision 5520
           Mobo: Dell model: 04GFKY v: A00 Bios: Dell v: 1.5.0 date: 08/30/2017
CPU:       Quad core Intel Xeon E3-1505M v6 (-HT-MCP-) cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 24000
           clock speeds: max: 4000 MHz 1: 1727 MHz 2: 1417 MHz 3: 1354 MHz 4: 1510 MHz 5: 949 MHz 6: 1430 MHz
           7: 1283 MHz 8: 1440 MHz
Graphics:  Card-1: Intel HD Graphics P630 bus-ID: 00:02.0
           Card-2: NVIDIA GM107GLM [Quadro M1200 Mobile] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 driver: nvidia Resolution: 3440x1440@49.99hz
           GLX Renderer: Quadro M1200/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 384.130 Direct Rendering: Yes

I have a somewhat uncommon setup in that I'm using linux on a laptop with Nvidia Optimus (Intel integrated graphics + discrete Nvidia mobile GPU). However I've configured linux to use the dedicated Nvidia GPU using nvidia-prime and verified the configuration (the inxi output above also reports the Nvidia card/driver being used as the graphics renderer).


I start glxgears:

$ glxgears -info
GL_RENDERER   = Quadro M1200/PCIe/SSE2
GL_VERSION    = 4.5.0 NVIDIA 384.130
GL_VENDOR     = NVIDIA Corporation

and in htop I see:

enter image description here

I also ran oprofile to get a report of what my CPU was doing, which gave me:

CPU: Intel Architectural Perfmon, speed 4000 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
  samples|      %|
  4232537 100.000 glxgears
          samples|      %|
          3155713 74.5584 kallsyms
           523169 12.3606 libnvidia-glcore.so.384.130
           332903  7.8653 libc-2.23.so
           177315  4.1893 libGL.so.384.130
            27398  0.6473 .glxj5h8n
             3605  0.0852 libxcb.so.1.1.0
             3396  0.0802 libX11.so.6.3.0
             3273  0.0773 libm-2.23.so
             2594  0.0613 glxgears
             1218  0.0288 [vdso] (tgid:10292 range:0x7ffc294d2000-0x7ffc294d3fff)
              706  0.0167 .glWqJoPX
              682  0.0161 libXext.so.6.4.0
              366  0.0086 .glhBcsou
               68  0.0016 snd_usb_audio
               51  0.0012 nvidia
               41 9.7e-04 iwlwifi
               18 4.3e-04 kvm
               15 3.5e-04 x86_pkg_temp_thermal
                2 4.7e-05 hid
                2 4.7e-05 mac80211
                2 4.7e-05 nvidia_uvm

Based on that glxgears is definitely using the nvidia backend so I'm confused why a pure graphics application, using a gpu, would also have high single core cpu usage?


I am not a linux expert, but kallsyms is the kernel, and I see google chatter about high CPU in kernel/kallsyms on laptops where there is/was a kernel bug related to USB dynamic power management (see for example: https://askubuntu.com/questions/1044872/ubuntu-16-04-kworker-using-high-cpu-constantly).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.