# Optimus laptop...How to use the on-demand mode?

**URL:** <https://forums.developer.nvidia.com/t/optimus-laptop-how-to-use-the-on-demand-mode/156534>\
**Category:** Linux\
**Created:** [October 7, 2020, 7:57pm UTC](https://forums.developer.nvidia.com/t/optimus-laptop-how-to-use-the-on-demand-mode/156534 "2020-10-07T19:57:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hilrie](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hilrie](https://forums.developer.nvidia.com/u/hilrie)\
**Post date:** [October 7, 2020, 7:57pm UTC](https://forums.developer.nvidia.com/t/optimus-laptop-how-to-use-the-on-demand-mode/156534/1 "2020-10-07T19:57:56Z")

</div>

I know that I have to run programs with certain environment variables:

(1) If the program uses Vulkan, `__NV_PRIME_RENDER_OFFLOAD=1` is enough.  
(2) `__GLX_VENDOR_LIBRARY_NAME=nvidia` is only needed when using GLX.  
(3) How do I know which program uses Vulkan and which uses GLX ? Is there a downside to using both ` __NV_PRIME_RENDER_OFFLOAD=1` and `__ GLX_VENDOR_LIBRARY_NAME=nvidia` ?

Is running ALL programs with both ` __NV_PRIME_RENDER_OFFLOAD=1` and `__ GLX_VENDOR_LIBRARY_NAME=nvidia` a good idea ? Or should I figure out which program uses GLX and which uses Vulkan ?
