# VirtualGL in OOD apps

**URL:** <https://discourse.openondemand.org/t/virtualgl-in-ood-apps/750>\
**Category:** Get Help\
**Created:** [February 24, 2020, 9:03pm UTC](https://discourse.openondemand.org/t/virtualgl-in-ood-apps/750 "2020-02-24T21:03:47Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Micket](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/micket/32/829_2.png) [@Micket](https://discourse.openondemand.org/u/Micket)\
**Post date:** [October 4, 2021, 10:29am UTC](https://discourse.openondemand.org/t/virtualgl-in-ood-apps/750/10 "2021-10-04T10:29:15Z")

</div>

Tip for anyone finding this thread: Using the latest VirtualGL (which is still sort-of in beta) [2.6.90 (3.0 beta1)](https://github.com/VirtualGL/virtualgl/releases/tag/3.0beta1)  
you can use the EGL backend.

My slurm taskprolog sets

```auto
if 'CUDA_VISIBLE_DEVICES' in os.environ:
    # Most reliable way to find the dri device:
    gpu_bus_id = commands.getoutput('nvidia-smi --query-gpu=gpu_bus_id --format=csv,noheader').split('\n')[0]
    # Need to strip off first 4 zeros
    dri_device = commands.getoutput('ls -d /sys/bus/pci/devices/{0}/drm/card*'.format(gpu_bus_id[4:])).split('/')[-1]
    print('export VGL_DISPLAY=/dev/dri/{0}'.format(dri_device))

```

In addition, you need to set the render device permissions. Since the nvidia device should be locked down to the right GPU anyway, I think it’s safe to set

```auto
# cat /etc/udev/rules.d/99-virtualgl-dri.rules 
KERNEL=="renderD*", MODE="0666", OWNER="root", GROUP="root"

```

No need to set up an X server. VirtualGL will run on the correct GPU. Works for all GLX apps I’ve tested (matlab, mathematica, glxgears, etc)

---

_[View the full topic](https://discourse.openondemand.org/t/virtualgl-in-ood-apps/750)._
