Original Source of these documents and files: https://forums.developer.nvidia.com/t/option-coolbits-is-not-used-optimus-enabled-laptop-running-an-rtx-2070-manjaro-linux/111771/13
DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The script assumes you have a valid ${HOME}/.xinitrc to start your X session.
If you can't start your window manager with startx command, then first learn
how to do it.
It also assumes you have all the proper drivers and nvidia-settings installed.
Refer to the wiki pages of your distro for further instructions on this topic.
It is always a good idea to backup your configuration files.
Check all your configuration files: /etc/X11/xorg.conf and/or files inside
/etc/X11/xorg.conf.d/. If you have any custom options inside sections of type
"Device" and "Screen", merge them with the sections inside the 10-nvidia.conf
provided in this package, unless you have a multihead setup. In that case, I do
not know how to properly merge the configuration files, but it should be
relatively easy to do (probably keeping the external monitor section intact and
merging the rest).
If you have any "ServerLayout" section, remove it. Chances are it only contains
configurations required to setup PRIME or PRIME Render Offload. If you know
you have other unrelated options inside it, migrate them to offload.layout
and prime.layout.
You also need to check the BusID of your video cards, they are required inside
10-nvidia.conf. Refer to Arch Wiki for more information on how to check it:
https://wiki.archlinux.org/index.php/Xorg#More_than_one_graphics_card
Change the values inside 10-nvidia.conf to match the ones of your system.
After updating 10-nvidia.conf, offload.layout, and prime.layout with all
the specific configurations of your system, you can move these files to
/etc/X11/xorg.conf.d.
Also create a symbolic link to the Render Offload layout: sudo ln -sf /etc/X11/xorg.conf.d/offload.layout /etc/X11/xorg.conf.d/00-layout.conf
With all of that done, your startx command should work as usual.
There are three variables you must edit inside startx-oc.sh:
glx_offset: the desired graphics clock offset;mem_offset: the desired memory clock offset;perf_level: maximum performance level of your card (e.g. 2).
Further instructions and suggestions are given inside startx-oc.sh.
To use it, make sure it has permission to excute: chmod +x startx-oc.sh and
simply execute it with ./startx-oc.sh. It will ask for your password one time
to allow sudo. It is possible to circumvent this requirement, but I don't
mind it, so it is up to you if you want to modify everything to work without
password.
Good luck! Hexengraf