Coder Social home page Coder Social logo

nelsonaloysio / envycontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bayasdev/envycontrol

1.0 1.0 0.0 141 KB

Easy GPU switching for Nvidia Optimus laptops under Linux

Home Page: https://bayas.dev/envycontrol

License: MIT License

Python 100.00%

envycontrol's Introduction

EnvyControl Logo

๐Ÿ‘โ€๐Ÿ—จ EnvyControl

EnvyControl is a program aimed to provide an easy way to switch GPU modes on Nvidia Optimus systems (i.e laptops with hybrid Intel + Nvidia or AMD + Nvidia graphics configurations) under Linux.

๐Ÿ“– License

EnvyControl is free and open-source software released under the MIT license.

โš ๏ธ Disclaimer

This software is provided 'as-is' without any express or implied warranty.

Keep it mind any custom X.org configuration may get deleted or overwritten when switching modes, please review this README and the source code before proceeding.

๐Ÿง Compatible distros

EnvyControl should work on any distribution of Linux, see tested distros.

If you're using Ubuntu or its derivatives please follow these instructions.

๐Ÿ–ฅ๏ธ Supported display managers

  • GDM
  • SDDM
  • LightDM

If your display manager isn't currently supported by EnvyControl you might have to manually configure it.

๐Ÿ’ก Tips

Wayland session is missing on Gnome 43+

Latest changes in GDM now require NVreg_PreserveVideoMemoryAllocations kernel parameter to be set to 1 as well as nvidia-suspend services to be enabled for Wayland sessions to appear.

# 1. Re-run EnvyControl 2.2+ (either nvidia or hybrid mode)
sudo envycontrol -s nvidia

# 2. Now enable the required Nvidia services
sudo systemctl enable nvidia-{suspend,resume,hibernate}

# 3. Reboot

/usr/share/sddm/scripts/Xsetup is missing on my system

Please run sudo envycontrol --reset-sddm.

โฌ‡๏ธ Getting EnvyControl

Arch Linux (AUR)

  1. yay -S envycontrol.
  2. Run sudo envycontrol -s <MODE> to switch graphics modes.

From source

  1. Clone this repository with git clone https://github.com/bayasdev/envycontrol.git or download the latest tarball from the releases page.
  2. Run sudo python envycontrol.py -s <MODE> from the root of the repository to switch to a different graphics mode.

Install globally as a pip package

  • From the root of the cloned repository run sudo pip install .
  • Now you can run sudo envycontrol -s <MODE> from any directory to switch graphics modes.

โšก๏ธ Usage

usage: envycontrol.py [-h] [-v] [-s MODE] [-q] [--dm DISPLAY_MANAGER] [--reset_sddm]

options:
  -h, --help            show this help message and exit
  -v, --version         show this program's version number and exit
  -s MODE, --switch MODE
                        switch the graphics mode, supported modes: integrated, hybrid, nvidia
  -q, --query           query the current graphics mode set by EnvyControl
  --dm DISPLAY_MANAGER  Manually specify your Display Manager. This is required only for systems without systemd. Supported DMs: gdm, sddm, lightdm
  --reset_sddm          restore original SDDM Xsetup file

Read a detailed explanation about EnvyControl graphics modes here.

Usage examples

Set current graphics mode to integrated (power off the Nvidia dGPU):

sudo envycontrol -s integrated

Set current graphics mode to nvidia (automatic display manager setup)

sudo envycontrol -s nvidia

Set current graphics mode to nvidia and setup SDDM display manager

sudo envycontrol -s nvidia --dm sddm

Query the current graphics mode:

envycontrol --query

๐Ÿ“ฆ Gnome Extension

The GPU profile selector extension provides a simple way to switch between graphics modes in a few clicks, you can get it from here.

Make sure to have EnvyControl installed globally!

gpu profile selector screenshot

โ“ Frequently Asked Questions (FAQ)

๐Ÿ“ Roadmap for v3

  • Make customizable options available as switches (eg: RTD3, composition pipeline, etc).
  • Nvidia mode on Wayland (Nvidia needs to fix their Linux drivers first).
  • Plasma applet.
  • COPR package.

๐Ÿž I found a bug

Feel free to open an issue, don't forget to provide some basic info such as:

  • Linux distribution
  • Linux kernel version and type
  • Desktop Environment or Window Manager as well as your Display Manager
  • Nvidia driver version
  • EnvyControl version

envycontrol's People

Contributors

bayasdev avatar cronyakatsuki avatar davikingman avatar gsegalini avatar luciogi avatar mphe avatar nelsonaloysio avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.