```
# If we are dealing with NVIDIA PRIME, and runtimepm
# is supported, enable it
if (os.path.isfile('/run/nvidia_runtimepm_supported') and os.path.isfile('/usr/bin/prime-select')): print('Trying to select the on-demand PRIME profile')
try: subprocess.call(['prime-select', 'on-demand'])
except:
pass
# Create the override file for gpu-manager
with open('/etc/u-d-c-nvidia-runtimepm-override', 'w') as f: f.write('# File created by ubuntu-drivers\n')
```
RTD3 is a nvidia GPU feature to support runtime suspend.
On-demand would be a X offloading feature.
They are independent, according to discussion on https:/ /github. com/tseliot/ ubuntu- drivers- common/ issues/ 55.
Some parts need to be adjusted, e.g.
``` isfile( '/run/nvidia_ runtimepm_ supported' ) and
os.path. isfile( '/usr/bin/ prime-select' )):
print( 'Trying to select the on-demand PRIME profile')
subprocess .call([ 'prime- select' , 'on-demand'])
# If we are dealing with NVIDIA PRIME, and runtimepm
# is supported, enable it
if (os.path.
try:
except:
pass
# Create the override file for gpu-manager etc/u-d- c-nvidia- runtimepm- override' , 'w') as f:
f. write(' # File created by ubuntu-drivers\n')
with open('/
```