Select which GPU to use when starting ParaView

Hello,

I have a workstation with two dissimilar GPUs. I only have one display, so expectedly, only one of the GPUs (GPU-1) is connected to my display. When I open ParaView -> About, I see that ParaView only recognizes GPU-1.

Here’s my question: is there a way to tell ParaView to use the other GPU, i.e. GPU-2? (which is, by the way, not connected to my display)

Many thanks,
Amin

Which OS ?

Ubuntu

Is this two actual GPUs or a chipset and a GPU (optimus laptop) ?

Two actual GPUs: Quadro P400 which is connected to the monitor and RTX 8000

Did you setup Xorg with the two cards ?
What is the output of xrandr ?

I’m not sure, here’s the output of xrandr:


Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 475mm x 267mm
   1920x1080     60.00*+
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)

You need to configure both screen as explained here :
https://wiki.archlinux.org/index.php/Multihead#Separate_screens

You have a fonctionnal example here :
https://bbs.archlinux.org/viewtopic.php?id=175130

This is not related to ParaView though. Once you have configured both screen and have multiple display, you will be able to use the secondary GPU for rendering within ParaView.

Thank you for your thorough response. Just to make sure, in order for ParaView to be able to use a GPU for rendering, that GPU must be connected to a physical monitor, is that correct?

I’m not entirely sure, as this is more in the domain of Xorg.

ParaView needs a valid DISPLAY id to be able to render to it using OpenGL.

You could trick paraview into using the second GPU for rendering while still displaying the GUI using the first GPU, by building a headless pvserver with EGL support.
Then you can start the EGL pvserver locally on the workstation and specify the second GPU for rendering (pvserver --egl-device-index=1).
Finally, connect to it from your paraview GUI, that is displayed using the first GPU, and configure it to use remote rendering only (Remote Render Threshold 0).
I just tested this on my workstation, and it seems to work.

3 Likes

I was hitting a similar issue with a laptop /w iGPU + NVIDIA dGPU, paraview would use my iGPU for rendering by default.
Make sure you have installed the NVIDIA (dkms) driver (check here for ubuntu), and that PRIME Render Offload is available.

You can then launch paraview with the following env variables:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia paraview

You can create a wrapper script for paraview, or an alias.
This command should work for other graphic application as well.

Credits to our intern @Tom.Clabault for the cmd line.

In case anyone searches for it on Windows and lands on this page.

The solution may be found on this discourse page

1 Like