I created 2 bash scripts to change Preset modes, the scripts are for GPU:0 if you have a second GPU in your system this can lead maybe to problems:
For max Performance:
#!/bin/bash
nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1"
For Auto Detection:
#!/bin/bash
nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=2"
You can also check your states in terminal with:
nvidia-settings -q GpuPowerMizerMode