Clarification of prime-run and DRI_PRIME


I have a laptop with dual GPU:

Graphics:  Device-1: Intel HD Graphics 530 driver: i915 v: kernel 
           Device-2: NVIDIA GM107GLM [Quadro M1000M] driver: nvidia v: 440.100 
           Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo 
           Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel HD Graphics 530 (SKL GT2) v: 4.6 Mesa 20.1.5 

I start steam with prime-run but I have some performance issue.

When I test with glxspheres64 the intel card I have:

➜ glxspheres64   
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0x3d1 (8/8/8/0)
OpenGL Renderer: Mesa Intel(R) HD Graphics 530 (SKL GT2)
64.045871 frames/sec - 71.475192 Mpixels/sec

with nvidia it’s the same performance result:

➜ prime-run glxspheres64
OpenGL Renderer: Quadro M1000M/PCIe/SSE2
60.584562 frames/sec - 67.612371 Mpixels/sec

But when I use DRI_PRIME=1 I have better performance (with two error) and it use the intel card:

➜ DRI_PRIME=1 glxspheres64
libGL error: failed to create dri screen
libGL error: failed to load driver: nouveau
GLX FB config ID of window: 0x3d1 (8/8/8/0)
OpenGL Renderer: Mesa Intel(R) HD Graphics 530 (SKL GT2)
532.371867 frames/sec - 594.127003 Mpixels/sec

So I don’t why it don’t use the Nvidia card with DRI_PRIME=1, and why the performance are the same with and without prime-run.

Thank ofr your help.

Because that not how to use that.
Notice how it tried to load nouveau ? Thats the opensource driver for nvidia.
It fails… then proceeds to use the intel.
My guess is this somehow disabled vsync.
Thats why the other ones are capped at ~60 fps… and that one isnt.

You really shouldnt use glxspheres as a benchmark… but if you want to disable vsync for equal compare do:

vblank_mode=0 glxspheres
vblank_mode=0 prime-run glxspheres

Thank for reply

With vblank_mode=0 glxspheres I have 667.932001 frames/sec
And with vblank_mode=0 prime-run glxspheres I have 60.978607 frames/sec

I also try with glxgears for benchmark. What can I use to do a correct benchmark ?

Do you know why it try to load nouveau with DRI_PRIME ? I thought that prime-run and DRI_PRIME=1 were equivalent

That’s an even worse option.

Use some real apps, like games. And use Nvidia proprietary driver, Nouveau is like 1000 times slower than it.

I think I don’t use nouveau (it’s blacklist in modprobe) it’s why I ask why with DRI_PRIME=1 it try to load nouveau

That still looks capped.
prime-run vblank_mode=0 glxspheres
But yes … this is still rather pointless.
Your prime-run is working fine.

Yes… because initially PRIME only worked with open drivers.
supporting proprietary nvidia was a later addition.
And since is proprietary nvidia … it works differently.

They do roughly the same thing … but no they arent the same.
prime-run is actually equal to


Ok thank @cscs it’s more obvious now
I will do a bench test with phoronix :slight_smile:

Edit: no diff prime-run vblank_mode=0 glxspheres

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.