Debian 12 bookworm LXQt版をインストール - その2 (APT, NVIDIAドライバの設定)
前回の続き。今回はDebian 12をインストール後にした設定を書きます。
目次
今回作業したノートPCのスペックは以下。
- CPU : Intel Core i7 9750H @ 4.50GHz
- メモリ : 16GB
- ストレージ : NVMe(PCIe 3.0) M.2 SSD 256GB
- GPU : NVIDIA GeForce GTX 1660 Ti mobile
- 解像度 : 1920x1080
APTの設定
- パネル (Windowsでいうタスクバー) からQTerminalを開く。
- ターミナルからVimをインストール。以下のコマンドを実行。
sudo apt update
sudo apt install vim - ターミナルで
sudo vim /etc/apt/source.list
を実行し、 /etc/apt/source.list を以下のように編集。
deb http://deb.debian.org/debian/ bookworm main non-free-firmware non-free contrib
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware non-free contrib
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware non-free contrib
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware non-free contrib
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware non-free contrib
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware non-free contrib - リポジトリを再び更新する。
sudo apt update
NVIDIAドライバのインストール
- 以下のコマンドでインストール。
- インストールが終わったら再起動し、以下のコマンドを実行。
nvidia-smi
以下のようなログが出ればOK.
- ドライバの導入自体はこれで完了。
しかし、筆者の環境ではドライバ導入後もNVIDIAのGPUが使用されていなかった。調べたところ、NVIDIAのGPUには NVIDIA Optimus という、NVIDIAのGPUと、CPUの内蔵GPUを切り替えて使用する機能があるのだが、どうも Debian 12 向けのNVIDIAドライバだとその辺が上手く自動設定されず、CPUの内蔵グラフィックスのみが使用されてしまうみたい。
この問題については、 X.org を手動設定することで解決できた。
- xrandr, x11-xserver-utils をインストール。
sudo apt install xrandr x11-xserver-utils - /etc/X11/xorg.conf を編集。
以下の文字列を追加。
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration"
EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
#Option "AccelMethod" "none"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection - SDDM (LXQtの標準ディスプレイマネージャ) のセットアップ時に実行されるコマンドを編集。
sudo vim /usr/share/sddm/scripts/Xsetup
/usr/share/sddm/scripts/Xsetup の最後尾に以下の文字列を追加。
上記の設定を終え、再起動するとNVIDIAのGPUが使用されるようになった。
参考 :https://wiki.debian.org/NVIDIA%20Optimus#Using_NVIDIA_GPU_as_the_primary_GPU
- xrandr, x11-xserver-utils をインストール。