Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
/ prime Public archive

Better Optimus for ArchLinux with power saving in mind, less configuring process needed.

License

Notifications You must be signed in to change notification settings

Kimiblock/prime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

No longer updated. See https://github.com/Kimiblock/moeOS.config for switchable graphics.

A utility aimed to achieve dual graphics switching with very low performance impact and automatically turns off NVIDIA GPUs to save power.

Install prime and required packages, run prime --first-use in your terminal, then enjoy it~

Install

Required packages (For folks who are using arch)

lib32-nvidia-utils #For 32-bit applications
nvidia #(nvidia-open, though not tested)
nvidia-utils #For nvidia-smi
cronie
polkit #For permission elevation, use with agents (example: polkit-kde-agent)
nvidia-settings #(Optional)
screen

Install prime

Open your terminal:

curl -O https://raw.githubusercontent.com/Kimiblock/prime/master/prime
sudo chown $USER:root prime
sudo mv prime /sbin
sudo chmod 755 /sbin/prime
prime --first-use

Start Applications on dGPU

Most Applications

_render=[all, display, vulkan] prime [command]
Syntax (_render) Effects
all Run Applications completely on dGPU
display Render you application on dGPU (Similar to prime-run)
vulkan Run only vulkan on dGPU ( Works on dxvk games like GTAV on Proton )

Steam games

Edit you properties, add

_render=vulkan prime %command% #for dxvk games
_render=all prime %command% #for other games

If you are encountering weird stutters with AMD APU + Nvidia, replace the above to

DXVA_ASYNC=1 PROTON_NO_ESYNC=1 RADV_DEBUG=llvm ENABLE_VKBASALT=0 _render=vulkan prime %command%

may help.

How does prime work?

Boot process

When your computer boots, nvidia module are blacklisted so that they won't be loaded.

Then, the crontab rule added by prime will enable kernel power management for your dGPU.

Offload applications

Once you call the command prime, it loads the nvidia kernel modules to offload Applications on your dGPU.

Deactivate dGPU

After all applications running through prime shutdown, it removes the nvidia kernel module so that other applications won't activate your graphics card from time to time. (As far as I know, Firefox activates dGPU every time when a video is being played.)

If any applications are using dGPU causing modprobe -r to fail, prime will send a desktop notification and elevate its permission to kill that process.

Advanced

If you do want to manually modprobe the kernel module, add --ignore-install 

About

Better Optimus for ArchLinux with power saving in mind, less configuring process needed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages