停止 fglrx 在引導時載入/解除安裝 fglrx 模組而不解除安裝它
我在筆記型電腦上安裝了 Fedora 19,它具有 Intel 集成顯卡和獨立 AMD 顯卡。我一直在使用該
radeon
驅動程序,它適用於大多數東西——儘管我最近嘗試了該fglrx
驅動程序,發現它速度更快,並且具有更好的電源管理,儘管一些基於 OpenGL 的程序無法正常執行。那麼如何
fglrx
在啟動時禁用驅動程序載入,使其回退到radeon
驅動程序上?我已經嘗試通過編輯
/etc/modprobe.d/blacklist-fglrx.conf
文件來做到這一點# Advanced Micro Devices, Inc. # radeon conflicts with AMD Linux Graphics Driver blacklist radeon
通過註釋該
blacklist radeon
行,並添加 `blacklist fglrx_pci
- 項目清單
`在它下面。這只是導致 GUI 登錄螢幕無法載入,所以我不得不切換到 TTY 並編輯回原來的樣子。
lspci -k``fglrx
已安裝(與未安裝的唯一區別Subsystem: Lenovo Radeon HD 6370M/7370M
未顯示,並radeon
用作 AMD 驅動程序* - 當剛剛列入黑名單時,我認為唯一的更改radeon
是使用):00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) Subsystem: Lenovo Device 3975 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09) Kernel driver in use: pcieport 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) Subsystem: Lenovo Device 397a Kernel driver in use: i915 00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04) Subsystem: Lenovo Device 3975 Kernel driver in use: mei 00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ehci-pci 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: snd_hda_intel 00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5) Kernel driver in use: pcieport 00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5) Kernel driver in use: pcieport 00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ehci-pci 00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: lpc_ich 00:1f.2 IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family 4 port SATA IDE Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ata_piix 00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05) Subsystem: Lenovo Device 3975 00:1f.5 IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family 2 port SATA IDE Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ata_piix 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Robson CE [Radeon HD 6370M/7370M] Subsystem: Lenovo Radeon HD 6370M/7370M Kernel driver in use: fglrx_pci 07:00.0 Ethernet controller: Qualcomm Atheros AR8152 v2.0 Fast Ethernet (rev c1) Subsystem: Lenovo Device 3979 Kernel driver in use: atl1c 08:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01) Subsystem: Broadcom Corporation Device 051b Kernel driver in use: bcma-pci-bridge
這是安裝程序製作的 RPM (安裝程序提供直接安裝或為 openSUSE 或 RedHat 建構包,我使用最新的 RedHat 64a 選項),這是從中提取的 RPM 安裝/解除安裝腳本。
我知道
modprobe
在系統啟動時嘗試使用刪除模組 - 這不起作用,導致modprobe: FATAL: Module fglrx is in use
.將驅動程序列入黑名單*(並刪除
/etc/X11/xorg.conf
- 安裝後需要創建一個fglrx
(看起來像這樣),而 Fedora無論如何都不需要一個)*的工作原理是使用 radeon 驅動程序 - 這裡的問題是,很多應用程序都沒有不行,Gnome Shell 和 GDM 顯示:但是,解除安裝驅動程序並重新啟動始終有效。
例如,將此黑名單應用於
/etc/modprobe.d/blacklist-fglrx.conf
:# Advanced Micro Devices, Inc. # radeon conflicts with AMD Linux Graphics Driver #blacklist radeon blacklist fglrx blacklist amd_iommu_v2 blacklist fglrx_pci
並刪除
xorg.conf
導致上述 GDM 錯誤。然後我可以(並且已經)切換到 TTY,並用於systemctl
從 GDM 切換到 LightDM 並登錄到 Xfce(這似乎工作正常)。諸如此類的應用程序cairo-dock
因分段錯誤而失敗。glxinfo
給出:name of display: :0.0 X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 153 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 12 Current serial number in output stream: 12
systemctl
將此顯示為 GDM 的狀態(在我切換到 LightDM + Xfce 之前),即使它崩潰了:gdm.service - GNOME Display Manager Loaded: loaded (/usr/lib/systemd/system/gdm.service; enabled) Active: active (running) since Mon 2014-11-10 17:15:27 GMT; 1min 34s ago Main PID: 471 (gdm) CGroup: name=systemd:/system/gdm.service ├─ 471 /usr/sbin/gdm ├─ 597 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Displays/_0 ├─ 921 /usr/bin/Xorg :0 -background none -verbose -auth /run/gdm/auth-for-gdm-l88Ufh/database -seat seat0 -nolisten tcp vt1 └─1102 gdm-session-worker [pam/gdm-launch-environment]
如下
lspci -k
:00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) Subsystem: Lenovo Device 3975 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09) Kernel driver in use: pcieport 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) Subsystem: Lenovo Device 397a Kernel driver in use: i915 00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04) Subsystem: Lenovo Device 3975 Kernel driver in use: mei 00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ehci-pci 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: snd_hda_intel 00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5) Kernel driver in use: pcieport 00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5) Kernel driver in use: pcieport 00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ehci-pci 00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: lpc_ich 00:1f.2 IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family 4 port SATA IDE Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ata_piix 00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05) Subsystem: Lenovo Device 3975 00:1f.5 IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family 2 port SATA IDE Controller (rev 05) Subsystem: Lenovo Device 3975 Kernel driver in use: ata_piix 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Robson CE [Radeon HD 6370M/7370M] Subsystem: Lenovo Radeon HD 6370M/7370M Kernel driver in use: radeon 07:00.0 Ethernet controller: Qualcomm Atheros AR8152 v2.0 Fast Ethernet (rev c1) Subsystem: Lenovo Device 3979 Kernel driver in use: atl1c 08:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01) Subsystem: Broadcom Corporation Device 051b Kernel driver in use: bcma-pci-bridge
這裡還有來自
/var/log/gdm/:0.log
,/var/log/Xorg.0.log
&的日誌/var/log/Xorg.0.log.old
- 我檢查了每個日誌的時間戳,我認為 GDM 和舊的 Xorg 日誌是正確的日誌 - 後面的 Xorg 日誌是來自目前 Xfce 會話的日誌,也應該是相關的。我認為問題是在某個地方仍然有一些配置告訴它使用 fglrx 驅動程序,或者有一個更新檔版本的 libGL(或類似的東西)安裝了 fglrx 需要 fglrx(在這種情況下這可能是無法解決的…… ….)。
我最終只寫了一個腳本,可以用來安裝和解除安裝驅動程序,以及設置
xorg.conf
我的系統需要它:#!/bin/bash if [[ ! $(whoami) = "root" ]]; then echo -e "\033[1;31mPlease run this as root\033[0m" exit 1 fi if [ "$1" = "enable" ]; then echo -e "\033[22;34mInstalling fglrx... ('/usr/share/fglrx64_p_i_c.x86_64')\033[1m\033[0m" sleep 3 sudo rpm -ivh /usr/share/fglrx-amd-RPM/fglrx64_p_i_c-14.301.1001-1.x86_64.rpm if [ -f "/etc/X11/xorg.conf" ]; then echo "Backing up 'etc/X11/xorg.conf'" mv "/etc/X11/xorg.conf" "/etc/X11/xorg.conf.bak.$(date)" fi echo "Preparing /etc/X11/xorg.conf" echo -e 'Section "ServerLayout"\n Identifier "aticonfig Layout"\n Screen 0 "aticonfig-Screen[0]-0" 0 0\nEndSection\n\nSection "Module"\nEndSection\n\nSection "Monitor"\n Identifier "aticonfig-Monitor[0]-0"\n Option "VendorName" "ATI Proprietary Driver"\n Option "ModelName" "Generic Autodetecting Monitor"\n Option "DPMS" "true"\nEndSection\n\nSection "Device"\n Identifier "aticonfig-Device[0]-0"\n Driver "fglrx"\n BusID "PCI:1:0:0"\nEndSection\n\nSection "Screen"\n Identifier "aticonfig-Screen[0]-0"\n Device "aticonfig-Device[0]-0"\n Monitor "aticonfig-Monitor[0]-0"\n DefaultDepth 24\n SubSection "Display"\n Viewport 0 0\n Depth 24\n EndSubSection\nEndSection\n' > "/etc/X11/xorg.conf" elif [ "$1" = "disable" ]; then echo "\033[22;34mUninstalling fglrx... ('fglrx64_p_i_c.x86_64')\033[1m\033[0m" sleep 3 sudo rpm -ev fglrx64_p_i_c.x86_64 else lsmod | grep fglrx echo -e "\033[22;34mThe options for the script are 'enable' 'disable'\033[1m\033[0m" fi exit
我也許可以嘗試拆開rpm 腳本,看看它在安裝/解除安裝期間做了什麼,但我認為上述解決方案更簡單。
使用modprobe命令。假設驅動程序稱為 radeon 和 fglrx,您可以:
modprobe -r radeon modprobe -r fglrx
為了檢查這些是否真的是正確的模組,請執行lsmod
假設這些程序可以滿足您的需要,您可以編輯您的模組