with Nvdia official drivers, high cpu consumption with glx apps, and in some cases firefox etc

problem:
I’ve an Nvidia gtx1070 and the propriety Nvidia drivers installed.

this can be reproduced, install the rss-glx screen savers
https://software.opensuse.org/package/rss-glx
and run rss-glx-pixelcity
you would observe very high cpu consumption and it is not literally using the GPU
this can be checked with things like “nvidia-smi stats” etc
this happens on installing the nvidia drivers or updating the nvidia drivers

solution:
check the alternatives for libglx.so
sudo update-alternatives --config libglx.so

There are 2 choices for the alternative libglx.so (providing /usr/lib64/xorg/modules/extensions/libglx.so).

Selection Path Priority Status

  • 0 /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so 100 auto mode
    1 /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so 100 manual mode
    2 /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so 50 manual mode

it turns out libglx is pointing to that provided by xorg. i.e. option 2. as that do not have access to the nvidia propriety hardware it uses the cpu cores instead to process gpu graphics, hence the high cpu consumption.
update the alternatives for libglx to the nvidia propriety libglx.so .so solves the problem