# linux禁用独显 URL: https://chengjinfang.com/posts/2017/linux-graphics/ Author: 程锦方 Date: 2017-06-26 Tags: #linux #note Summary: 在 Linux 上编译安装 BBSwitch,查看并切换独立显卡的状态。 ------------------------------------------------------------------------ ## 使用BBSwitch禁用独显 #### 安装编译环境,内核源码和内核头文件 ``` apt-get install build-essential #安装编译环境 apt-get install linux-source #安装内核源文件 apt-get install linux-headers-$(uname -r) #这安装对应当前内核版本的头文件 ``` #### 查看当前的显卡 ``` lspci | grep VGA ``` #### 下载BBswitch源码,并编译安装 https://github.com/Bumblebee-Project/bbswitch ``` make sudo make load make -f Makefile.dkms ``` #### 开启或者禁用独显 ``` modprobe bbswitch #加载bbswitch模块 sudo tee /proc/acpi/bbswitch << /sys/kernel/debug/vgaswitcheroo/switch #切换到集成显卡 echo OFF > /sys/kernel/debug/vgaswitcheroo/switch #关掉没有连接的显卡 cat /sys/kernel/debug/vgaswitcheroo/switch #查看显卡状态 ``` ------------------------------------------------------------------------ Site: https://chengjinfang.com/ · All Index: https://chengjinfang.com/all/ · RSS: https://chengjinfang.com/rss.xml