我無法讓我的筆記型電腦(Lenovo Legion 5)識別我的第二個螢幕。它有 Nvidia RTX 3060 和第二張卡:
❯ lspci -nnk | grep "VGA\|'Kern'\|3D\|Display" -A2
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] [10de:2560] (rev a1)
Subsystem: Lenovo GA106M [GeForce RTX 3060 Mobile / Max-Q] [17aa:3a81]
Kernel driver in use: nvidia
--
06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c6)
Subsystem: Lenovo Cezanne [17aa:3a81]
Kernel driver in use: amdgpu
在 中 update-alternatives
,使用“當前”:
❯ sudo update-alternatives --config nvidia
Il existe 2 choix pour l'alternative nvidia (qui fournit /usr/lib/nvidia/nvidia).
Sélection Chemin Priorité État
------------------------------------------------------------
0 /usr/lib/nvidia/tesla-510 510 mode automatique
* 1 /usr/lib/nvidia/current 470 mode manuel
2 /usr/lib/nvidia/tesla-510 510 mode manuel
Hashcat 正確偵測 CUDA:
❯ hashcat -I
hashcat (v6.2.5) starting in backend information mode
CUDA Info:
==========
CUDA.Version.: 11.4
Backend Device ID #1 (Alias: #2)
Name...........: NVIDIA GeForce RTX 3060 Laptop GPU
Processor(s)...: 30
Clock..........: 1425
Memory.Total...: 5946 MB
Memory.Free....: 5838 MB
PCI.Addr.BDFe..: 0000:01:00.0
OpenCL Info:
============
OpenCL Platform ID #1
Vendor..: NVIDIA Corporation
Name....: NVIDIA CUDA
Version.: OpenCL 3.0 CUDA 11.4.231
Backend Device ID #2 (Alias: #1)
Type...........: GPU
Vendor.ID......: 32
Vendor.........: NVIDIA Corporation
Name...........: NVIDIA GeForce RTX 3060 Laptop GPU
Version........: OpenCL 3.0 CUDA
Processor(s)...: 30
Clock..........: 1425
Memory.Total...: 5946 MB (limited to 1486 MB allocatable in one block)
Memory.Free....: 5824 MB
OpenCL.Version.: OpenCL C 1.2
Driver.Version.: 470.129.06
PCI.Addr.BDF...: 01:00.0
OpenCL Platform ID #2
Vendor..: The pocl project
Name....: Portable Computing Language
Version.: OpenCL 2.0 pocl 1.8 Linux, None+Asserts, RELOC, LLVM 11.1.0, SLEEF, DISTRO, POCL_DEBUG
Backend Device ID #3
Type...........: CPU
Vendor.ID......: 1
Vendor.........: AuthenticAMD
Name...........: pthread-AMD Ryzen 5 5600H with Radeon Graphics
Version........: OpenCL 1.2 pocl HSTR: pthread-x86_64-pc-linux-gnu-generic
Processor(s)...: 12
Clock..........: 3300
Memory.Total...: 11857 MB (limited to 2048 MB allocatable in one block)
Memory.Free....: 5896 MB
OpenCL.Version.: OpenCL C 1.2 pocl
Driver.Version.: 1.8
我沒有任何 /etc/X11/xorg.conf 檔案。如果我用 產生一個nvidia-xconfig
,我會在重新啟動時看到一個閃爍的遊標。
可切換顯示卡在 BIOS 中啟用。
當我以 HDMI 連接螢幕時,沒有任何反應...並且熱鍵 Win+P 或 Fn+F7 沒有任何反應。
任何想法 ?
答案1
經過幾個小時並混合了許多不同的想法後,我成功地使其發揮作用並交付了“我的”解決方案。那裡幾乎沒有什麼黑魔法,但它對我有用...
- 請勿使用 Nvidia 專有驅動程式(此處為 nvidia-tesla510)或任何其他軟體包,如 optimus、prime、bumblebee 等
sudo apt purge nvidia-*
。如果存在任何依賴關係錯誤,請將其刪除。然後重新啟動。確認您的系統上沒有安裝任何 Nvidia 軟體包(包括 Cuda)。使用 刪除任何多餘的套件apt autoremove
。我個人建議不要安裝任何未由穩定儲存庫正式分發的軟體包。重啟。 - 遵循 Kali 安裝指南,基本上:
sudo apt update
sudo apt -y full-upgrade -y
[ -f /var/run/reboot-required ] && sudo reboot -f
sudo apt install -y nvidia-driver nvidia-cuda-toolkit
- 連接第二個螢幕的螢幕檢測:
xrandr -q
。您應該會在清單中看到已連接的第二個畫面。但是,即使如此,也不足以讓訊號通過第二個螢幕。 - 現在您可以重新啟動(也許沒用 - 我知道)
- 寫出自己的
/etc/X11/xorg.conf
,靈感來自:http://us.download.nvidia.com/XFree86/Linux-x86/375.39/README/randr14.html。或者您可以使用套件nvidia-xconfig
(apt install nvidia-xconfig
) 然後啟動:sudo nvidia-xconfig
。您可以驗證是否/etc/X11/xorg.conf
寫入了新文件。這是我的:
❯ cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 470.103.01
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia" 0 0
Inactive "amdgpu"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:01:0:0"
EndSection
Section "Device"
Identifier "amdgpu"
Driver "modesetting"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Monitor "Monitor0"
DefaultDepth 24
Option "AllowEmptyInitialConfiguration"
SubSection "Display"
Depth 24
Modes "nvidia-auto-select"
EndSubSection
EndSection
Section "Screen"
Identifier "amdgpu"
Device "amdgpu"
Monitor "Monitor0"
EndSection
如果您有基於 Intel 的混合顯示卡,您將擁有“intel”而不是“amdgpu”。
- 重新啟動,交叉手指,就完成了。如果它不起作用(遊標閃爍、黑屏...),請進入另一個終端(Alt+F2),刪除
xorg.conf
,重新啟動,並嘗試通過繼續指責Nvidia、Intel、AMD 和您最喜歡的製造商來找到另一個解決方案感謝他們對 Linux 的良好軟體支援。祝你好運。
答案2
(Legion 5), AMD 按 F9 進入 Bios 設定選單,只需選擇獨立顯示卡並重新啟動系統。