Skip to content
forked from sk3l/optiflip

Nvidia <~> Intel Hybrid Graphics Helper Scripts

Notifications You must be signed in to change notification settings

jingglang/optiflip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

optiflip - Nvidia <~> Intel Hybrid Graphics Helper Scripts

This repo contains some helper scripts and sample X11 configs to assist in manually changing the active graphics card in an Optimus hybrid graphics machine, switching back/forth between Nvidia and Intel. The process relies on the bbswitch kernel module available for Optimu laptops, used for toggling the active graphics card. With this, you can switch between graphics whilst your laptop is running, without rebooting, only necessitating a bounce of X11.

The inspiration of these tools is this documentation from Arch Linux on the Lenovo Thinkpad P1 laptop.

DISCLAIMER

Use of these instructions and this code IS AT-WILL; USE AT YOUR OWN RISK. I am not responsible for any issues or problems you incur in using the code, configuration or following these instructions.

Installation

  1. Copy the contents of /scripts folder to a location in your $PATH, e.g. /usr/local/sbin
│mskelton@panther ~ $ sudo cp scripts/* /usr/local/sbin
  1. Copy the contents of /conf folder to /etc/X11. IMPORTANT, you should consider backing up any existing xorg.conf you already have in place.
│mskelton@panther ~ $ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.BAK
│mskelton@panther ~ $ sudo cp /conf/* /etc/X11

Use

  1. You can call the lsgfx helper script to let you know which card your hybrid graphics is currently using:
mskelton@panther ~ $ lsgfx
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 8.0, 256 bits)
  1. Open a new TTY using <ctl+alt+F2> (F3, F4, etc. can be used instead)

  2. Execute the script for the graphics card you wish to activate e.g. gfxnvidia

** !!! BEWARE !!! this will TERMINATE your current X11 session in order to switch the graphics card and start a new X11 session. ** You should back up any work you wish to not lose at this point in running GUI apps.

mskelton@panther ~ $ gfxnvidia
ON
  1. Your desktop manager will have been restarted (assuming your using e.g. SDDM or another modern variety). Log back into an X11 session.

  2. Confirm that the active graphics card has alternated.

mskelton@panther ~ $ lsgfx
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro P2000 with Max-Q Design/PCIe/SSE2

About

Nvidia <~> Intel Hybrid Graphics Helper Scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published