我的 Thinkpad X1 Extreme 有 Nvidia 1050ti 和 iGPU。如何启用 GPU 的混合自动和手动切换?

我的 Thinkpad X1 Extreme 有 Nvidia 1050ti 和 iGPU。如何启用 GPU 的混合自动和手动切换?

在 Thinkpad X1 Extreme 上安装了 18.10。需要先在 BIOS 中更改为独立显卡才能做到这一点。安装后仅使用 Nvidia 1050ti。如何启用 GPU 的自动混合切换以及两个 GPU 的手动切换?谢谢

答案1

我看到有很多帖子询问如何正确设置带有 Ubuntu 的 Thinkpad X1E。这些是我的安装说明(注意,我使用 Nvidia X Server 在英特尔和 nvidia 显卡之间切换 - 这仍然需要注销并登录)。

My Laptop: Thinkpad X1E (Gen 1)
Laptop           = LENOVO ThinkPad X1 Extreme 20MGS0EQ00
BIOS             = N2EET42W (1.24 )
Operating System = Dual Boot - Windows 10 / Ubuntu 18.04.3 LTS

Relevant status on Ubuntu 18.04.3:
  * System running on BIOS > Hybrid Graphics
  * Can switch between intel and nvidia using the Nvidia X Server application (requires log out/log in)
  * External monitor can be connected through the HDMI port (only available when nvidia card is used) [R2]
  * Power-saving mode is automatically switched on when on battery by TLP [R1]

[R1] https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
[R2] (pomm0's answer) https://www.dell.com/community/Precision-Mobile-Workstations/External-Monitor-not-working-Ubuntu-nvidia/td-p/6241315

Installation instructions:
 ** 0. First install Windows 10 or stick to pre-installed Windows 10  **
 ** 1. Update the BIOS firmware to the latest version **
    A short google query will let you know that Lenovo had problems with some old BIOS version that would render your 
laptop unsuble if you tried to switch the Graphics Device on the BIOS to "Discrete". The fact that a lot of people
recommended switching to "Discrete" graphics during the Ubuntu installation did not help.
    Anyway, short answer: update the BIOS firmware to the latest version.
 ** 2. Set the Graphics Device on the BIOS to "Hybrid Graphics" **
    BIOS/System Setup > Config > Display > Graphics Device > Hybrid Graphics
 ** 3. Test boot using Ubuntu live stick with "nomodeset" **
    In Grub (the menu that appears when you boot from the stick before starting Ubuntu) click "e" with the option 
"Try Ubuntu without installing", and add "nomodeset" in the GRUB in the line that has "quiet splash ---". Then press
F10 to proceed with the boot (and try Ubuntu without installing). If the Ubuntu desktop loads normally then you are 
good to go.
    Note: with the "nomodeset" option, only the intel graphics can be used.
    Note-2: even once Ubuntu is installed, you can still use the "nomodeset" option to make sure that the nvidia card 
will not be used (once the system is set up correctly there is no need to do this anymore).
 ** 4. Install Ubuntu as usual, with a separate swap partition of size equals to your RAM size (16 GB for me) **
 ** 5. Try booting Ubuntu normally (without adding "nomodeset") **
    If it boots normally, then try to install the nvidia-driver-390.
    Note: I have tested also the latest driver recommended by "ubuntu-drivers devices" (nvidia-driver-440) and it also
          works fine. It seems to consume more power than he 390 driver though, and the output of the command 
          "lshw -numeric -C display" looks different (nvidia card appears as UNCLAIMED when in intel graphics).
    Approximate instructions: 
      sudo apt update
      sudo apt upgrade
      sudo add-apt-repository ppa:graphics-drivers/ppa
      sudo apt update
      ubuntu-drivers devices
      sudo apt install nvidia-driver-390
      sudo apt upgrade
      (unsure about the necessity of this) Blacklist nouveau driver using GRUB config. In /etc/default/grub look for a line GRUB_CMDLINE_LINUX . Add nouveau.blacklist=1 into that parameter. If the line is not present add this line GRUB_CMDLINE_LINUX="nouveau.blacklist=1"
      (unsure about the necessity of this) sudo update-grub
    restart the computer. Hopefully you can get back to the Ubuntu desktop screen without problems.
 ** 6. Test switching from intel to nvidia graphics using the "Nvidia X Server" application **
    Result: can switch between intel and nvidia graphics using the Nvidia X Server application (requires log out/log in)
    Additionally: Check output of the command: "lshw -numeric -C display"
    Remark: for me, the nvidia graphics card appears on the lshw output only when nvidia graphics is selected.
    Remark 2: After restart the last setting, intel or nvidia graphics, stays.
 ** 7. Change configuration as reparted in [R2] to make HDMI port accessible in Ubuntu **
    Result: External monitor can be connected through the HDMI port (only available when nvidia card is selected on the 
            Nvidia X Server)
    [R2] (pomm0's answer) https://www.dell.com/community/Precision-Mobile-Workstations/External-Monitor-not-working-Ubuntu-nvidia/td-p/6241315
    Open the file in your favorite editor (vim, nano, gedit, etc.).
      sudo nano /lib/modprobe.d/nvidia-kms.conf
    And comment out the the nvidia-drm modeset option.
      # This file was generated by nvidia-prime
      # Set value to 0 to disable modesetting
      # options nvidia-drm modeset=1
 ** 8. Best power-saving options using TLP [R1] - should work great on thinkpads **
    [R1] https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#check
    Installation:
      sudo add-apt-repository ppa:linrunner/tlp
      sudo apt-get update 
      sudo apt-get install tlp tlp-rdw
      # For ThinkPads an additional
      sudo apt-get install acpi-call-dkms 
      # Installing the tp-smapi-dkms package might be useless depending on your laptop model, see comments from linrunner below. For the Lenovo X1E it is useless, so I scrapped the corresponding line from the instructions.
      (restart and test commands listed on [R1])
    To test power consumption
      sudo apt install powertop
      sudo powertop
      # powertop: when running on battery consumption is displayed on the "Device Stats" tab
      sudo tlp-stat -s  # check that laptop detects being on battery or on AC (conntected to power supply)
      # powertop: check the "Tunables" tab, when on battery or on AC, this are configuration changes to make your laptop
                  consume less power
      # powertop: check power consumption with/without WiFi, min to max brightness and on intel or nvidia graphics.
    Note on power consumption with my laptop:  
      Consumption of computer WITHOUT Nvidia card in idle: min brightness, min reading 7.1W. (lowest ever reading 4-5W)
      Consumption of computer WITH Nvidia card in idle: min brightness, 11-20W. (min reading 11W)
 ** 9. Done! - Enjoy your well configured laptop - Additional tips are wellcome! ** 

相关内容