# Select which GPU to use when starting ParaView

**URL:** https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605
**Category:** ParaView Support
**Tags:** opengl
**Created:** [February 19, 2020, 3:29pm UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605 "2020-02-19T15:29:50Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![ma-sadeghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ma-sadeghi/32/7592_2.png) [@ma-sadeghi](https://discourse.paraview.org/u/ma-sadeghi)
#### Post date: [February 19, 2020, 3:29pm UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/1 "2020-02-19T15:29:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 2:11am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/2 "2020-02-20T02:11:44Z")

</div>

Which OS ?

---

<div class="post-metadata">

### Author: ![ma-sadeghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ma-sadeghi/32/7592_2.png) [@ma-sadeghi](https://discourse.paraview.org/u/ma-sadeghi)
#### Post date: [February 20, 2020, 2:33am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/3 "2020-02-20T02:33:52Z")

</div>

Ubuntu

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 2:55am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/4 "2020-02-20T02:55:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ma-sadeghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ma-sadeghi/32/7592_2.png) [@ma-sadeghi](https://discourse.paraview.org/u/ma-sadeghi)
#### Post date: [February 20, 2020, 3:01am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/5 "2020-02-20T03:01:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 3:02am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/6 "2020-02-20T03:02:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ma-sadeghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ma-sadeghi/32/7592_2.png) [@ma-sadeghi](https://discourse.paraview.org/u/ma-sadeghi)
#### Post date: [February 20, 2020, 3:38am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/7 "2020-02-20T03:38:42Z")

</div>

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

```auto

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)

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 3:51am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/8 "2020-02-20T03:51:41Z")

</div>

You need to configure both screen as explained here :  
[https://wiki.archlinux.org/index.php/Multihead#Separate\_screens](https://wiki.archlinux.org/index.php/Multihead#Separate_screens)

You have a fonctionnal example here :  
[https://bbs.archlinux.org/viewtopic.php?id=175130](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.

---

<div class="post-metadata">

### Author: ![ma-sadeghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ma-sadeghi/32/7592_2.png) [@ma-sadeghi](https://discourse.paraview.org/u/ma-sadeghi)
#### Post date: [February 20, 2020, 6:36pm UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/9 "2020-02-20T18:36:58Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 21, 2020, 2:55am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/10 "2020-02-21T02:55:00Z")

</div>

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.

> <https://askubuntu.com/questions/432255/what-is-the-display-environment-variable>

---

<div class="post-metadata">

### Author: ![lhofmann](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@lhofmann](https://discourse.paraview.org/u/lhofmann)
#### Post date: [February 21, 2020, 9:56am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/11 "2020-02-21T09:56:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ltetrel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ltetrel/32/15636_2.png) [@ltetrel](https://discourse.paraview.org/u/ltetrel)
#### Post date: [June 28, 2024, 7:59am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/12 "2024-06-28T07:59:11Z")

</div>

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](https://www.cyberciti.biz/faq/ubuntu-linux-install-nvidia-driver-latest-proprietary-driver/)), and that [PRIME Render Offload](https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/primerenderoffload.html) is available.

You can then launch paraview with the following env variables:

```sh
__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.

---

<div class="post-metadata">

### Author: ![Gatien\_Ferret](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gatien_ferret/32/9789_2.png) [@Gatien\_Ferret](https://discourse.paraview.org/u/Gatien_Ferret)
#### Post date: [June 28, 2024, 8:31am UTC](https://discourse.paraview.org/t/select-which-gpu-to-use-when-starting-paraview/3605/13 "2024-06-28T08:31:34Z")

</div>

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

The solution may be found on this [discourse page](https://discourse.paraview.org/t/running-on-gpu-from-windows/9339)
