AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 677899
Accepted
techsk8
techsk8
Asked: 2021-11-18 02:18:14 +0800 CST2021-11-18 02:18:14 +0800 CST 2021-11-18 02:18:14 +0800 CST

完全在 Nvidia 专用显卡上运行您的 Linux(显卡)?

  • 772

我正在运行一个 Arch,几个月来我一直在努力弄清楚如何在 Nvidia 专用 GPU 上完全运行我的Optimus 笔记本电脑。我该怎么做呢?我听说那里有多种选择,但我不知道如何解决!那么如何在 Linux 上享受我强大的NVIDIA GeForce GTX 1650 Ti Mobile呢?

有什么想法或设置可以帮助我在我的 Nvidia GPU 上运行任何与 GPU 相关的任务吗?

linux arch-linux
  • 1 1 个回答
  • 2836 Views

1 个回答

  • Voted
  1. Best Answer
    techsk8
    2021-11-18T02:18:14+08:002021-11-18T02:18:14+08:00

    我有一段时间遇到这个问题,直到我发现了一个实用程序来完成这一切。您可以使用ArchWiki了解 Optimus 笔记本电脑的工作原理。然后你有多种选择,但我建议运行optimus-manager。我在 X11 上使用 Gnome 运行 ArcoLinux,我必须说它运行完美。到目前为止,我没有任何问题 - 至少 1 年。

    仅供参考,这只适用于 X11,尚不支持 Wayland。

    安装后nvtop应该是这样的:

     Device 0 [NVIDIA GeForce GTX 1650 Ti] PCIe GEN 1@ 8x RX: 0.000 KiB/s TX: 0.000 KiB/s
     GPU 360MHz  MEM 405MHz  TEMP  43°C FAN N/A% POW   2 W
     GPU[||                                5%] MEM[||||                  0.413Gi/3.820Gi]
       ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    100│GPU0 %                                                                                                            │
       │GPU0 mem%                                                                                                         │
       │                                                                                                                  │
       │                                                                                                                  │
       │                                                                                                                  │
     75│                                                                                                                  │
       │                                                                                                                  │
       │                                                                                                                  │
       │                                                                                                                  │
       │                                                                                                                  │
     50│                                                                                                                  │
       │                                                                                                                  │
       │                                                                                                                  │
       │                    ┌───┐                                                                     ┌───┐               │
       │                ┌───┘   │                                                         ┌───┐       │   │               │
     25│                │       │           ┌───┐       ┌───┐                             │   └───────┘   │               │
       │                │       │           │   │       │   │                             │               └─────┐         │
       │────┐     ┌─────┘       │   ┌───────┘   └───┐   │   │ ┌───────┐   ┌───────────┐   │                     │         │
       │────┴─────┴─────────────┼───┼───────────────┴───┴───┴─┴───────┴───┴───────────┴───┴─────────────────────┴───────┬─│
       │                        └───┘                                                                                   └─│
      0│                                                                                                                  │
       └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
    115254   me   0 Graphic   0%    104MiB   3%     1%    223MiB /usr/lib/brave-bin/brave --type=gpu-process --field-trial-
      1827   me   0 Graphic   0%     43MiB   1%     1%    447MiB /usr/bin/gnome-shell
    114827   me   0 Graphic   0%     32MiB   1%     0%    160MiB /usr/lib/slack/slack --type=gpu-process --field-trial-hand
    123952   me   0 Graphic   0%      8MiB   0%     3%     62MiB alacritty
    164054   me   0 Graphic   0%      8MiB   0%     0%     57MiB alacritty
    

    我希望这有帮助!:)

    optimus-manager --status如果您完全在专用卡上运行,这是应该给出的输出:

    optimus-manager --status
    Optimus Manager (Client) version 1.4
    
    Current GPU mode : nvidia
    GPU mode requested for next login : no change
    GPU at startup : nvidia
    Temporary config path: no
    

    这是我的/etc/optimus-manager/optimus-manager.conf

    [optimus]
    
    # This parameter defines the method used to power switch the Nvidia card. See the documentation
    # for a complete description of what each value does. Possible values :
    #
    # - nouveau : load the nouveau module on the Nvidia card.
    # - bbswitch : power off the card using the bbswitch module (requires the bbswitch dependency).
    # - acpi_call : try various ACPI method calls to power the card on and off (requires the acpi_call dependency)
    # - custom: use custom scripts at /etc/optimus-manager/nvidia-enable.sh and /etc/optimus-manager/nvidia-disable.sh
    # - none : do not use an external module for power management. For some laptop models it's preferable to
    #          use this option in combination with pci_power_control (see below).
    switching=bbswitch
    
    # Enable PCI power management in "integrated" mode.
    # This option is incompatible with acpi_call and bbswitch, so it will be ignored in those cases.
    pci_power_control=no
    
    # Remove the Nvidia card from the PCI bus.
    # May prevent crashes caused by power switching.
    # Ignored if switching=nouveau or switching=bbswitch.
    pci_remove=no
    
    # Reset the Nvidia card at the PCI level before reloading the nvidia module.
    # Ensures the card is in a fresh state before reloading the nvidia module.
    # May fix some switching issues. Possible values :
    #
    # - no : does not perform any reset
    # - function_level : perform a light "function-level" reset
    # - hot_reset : perform a "hot reset" of the PCI bridge. ATTENTION : this method messes with the hardware
    #         directly, please read the online documentation of optimus-manager before using it.
    #         Also, it will perform a PCI remove even if pci_remove=no.
    #
    pci_reset=no
    
    # Automatically log out the current desktop session when switching GPUs.
    # This feature is currently supported for the following DE/WM :
    # GNOME, KDE Plasma, LXDE, Deepin, Xfce, i3, Openbox, AwesomeWM, bspwm and dwm
    # If this option is disabled or you use a different desktop environment,
    # GPU switching only becomes effective at the next graphical session login.
    auto_logout=yes
    
    # GPU mode to use at computer startup.
    # Possible values: nvidia, integrated, hybrid, auto, intel (deprecated, equivalent to integrated)
    # "auto" is a special mode that auto-detects if the computer is running on battery
    # and selects a proper GPU mode. See the other options below.
    startup_mode=nvidia
    # GPU mode to select when startup_mode=auto and the computer is running on battery.
    # Possible values: nvidia, integrated, hybrid, intel (deprecated, equivalent to integrated)
    startup_auto_battery_mode=nvidia
    # GPU mode to select when startup_mode=auto and the computer is running on external power.
    # Possible values: nvidia, integrated, hybrid, intel (deprecated, equivalent to integrated)
    startup_auto_extpower_mode=nvidia
    
    
    [intel]
    
    # Driver to use for the Intel GPU. Possible values : modesetting, intel
    # To use the intel driver, you need to install the package "xf86-video-intel".
    driver=modesetting
    
    # Acceleration method (corresponds to AccelMethod in the Xorg configuration).
    # Only applies to the intel driver.
    # Possible values : sna, xna, uxa
    # Leave blank for the default (no option specified)
    accel=sna
    
    # Enable TearFree option in the Xorg configuration.
    # Only applies to the intel driver.
    # Possible values : yes, no
    # Leave blank for the default (no option specified)
    tearfree=
    
    # DRI version. Possible values : 2, 3
    DRI=3
    
    # Whether or not to enable modesetting for the nouveau driver.
    # Does not affect modesetting for the Intel GPU driver !
    # This option only matters if you use nouveau as the switching backend.
    modeset=yes
    
    
    [amd]
    
    # Driver to use for the AMD GPU. Possible values : modesetting, amdgpu
    # To use the amdgpu driver, you need to install the package "xf86-video-amdgpu".
    driver=modesetting
    
    # Enable TearFree option in the Xorg configuration.
    # Only applies to the amdgpu driver.
    # Possible values : yes, no
    # Leave blank for the default (no option specified)
    tearfree=yes
    
    # DRI version. Possible values : 2, 3
    DRI=3
    
    
    [nvidia]
    
    # Whether or not to enable modesetting. Required for PRIME Synchronization (which prevents tearing).
    modeset=yes
    
    # Whether or not to enable the NVreg_UsePageAttributeTable option in the Nvidia driver.
    # Recommended, can cause poor CPU performance otherwise.
    PAT=yes
    
    # DPI value. This will be set using the Xsetup script passed to your login manager.
    # It will run the command
    # xrandr --dpi <DPI>
    # Leave blank for the default (the above command will not be run).
    DPI=96
    
    # If you're running an updated version of xorg-server (let's say to get PRIME Render offload enabled),
    # the nvidia driver may not load because of an ABI version mismatch. Setting this flag to "yes"
    # will allow the loading of the nvidia driver.
    ignore_abi=no
    
    # Set to yes if you want to use optimus-manager with external Nvidia GPUs (experimental)
    allow_external_gpus=no
    
    # Comma-separated list of Nvidia-specific options to apply.
    # Available options :
    # - overclocking : enable CoolBits in the Xorg configuration, which unlocks clocking options
    #   in the Nvidia control panel. Note: does not work in hybrid mode.
    # - triple_buffer : enable triple buffering.
    options=
    
    
    # Enable Runtime D3 (RTD3) Power Management in the Nvidia driver. While in hybrid mode,
    # this feature allows the Nvidia card to go into a low-power mode if it's not in use.
    #
    # IMPORTANT NOTES:
    # - The feature is still experimental
    # - It's only supported on laptops with a Turing GPU or above, and an Intel Coffee Lake CPU
    # or above (not sure about the state of support for AMD CPUs).
    # - if your Nvidia card also has an audio chip (for HDMI) or a USB port wired to it, they may not
    # function properly while in low-power mode
    #
    # For more details, see
    # https://download.nvidia.com/XFree86/Linux-x86_64/460.39/README/dynamicpowermanagement.html
    #
    # Available options:
    # - no (the default): RTD3 power management is disabled.
    # - coarse: the card only goes to low-power if no application is using it.
    # - fine: the card is also allowed to go to low-power if applications are using it but have not
    # actively submitted GPU work in some amount of time.
    dynamic_power_management=no
    
    # The Nvidia driver handles power to the video memory separately from the rest of GPU.
    # When dynamic_power_management=fine, this options controls the threshold of memory utilization
    # (in Megabytes) under which the memory is put in a low-power state.
    # Values over 200MB are ignored. Leave blank for the default (200MB).
    # Setting this value to 0 keeps the memory powered at all times.
    dynamic_power_management_memory_threshold=
    

    最后,这就是我所拥有的:

    neofetch
                        /-                      me@machine
                       ooo:                     ----------
                      yoooo/                    OS: ArcoLinux
                     yooooooo                   Kernel: 5.15.2-arch1-1
                    yooooooooo                  Uptime: 4 hours, 18 mins
                   yooooooooooo                 Packages: 1464 (pacman)
                 .yooooooooooooo                Shell: zsh 5.8
                .oooooooooooooooo               Resolution: 1920x1080
               .oooooooarcoooooooo              DE: GNOME 40.4
              .ooooooooo-oooooooooo             WM: Mutter
             .ooooooooo-  oooooooooo            WM Theme: Adwaita
            :ooooooooo.    :ooooooooo           Theme: Arc-Dark [GTK2/3]
           :ooooooooo.      :ooooooooo          Icons: Sardi-Arc [GTK2/3]
          :oooarcooo         .oooarcooo         Terminal: alacritty
         :ooooooooy           .ooooooooo        CPU: Intel i7-10750H (12) @ 5.000GHz
        :ooooooooo   /ooooooooooooooooooo       GPU: Intel CometLake-H GT2 [UHD Graphics]
       :ooooooooo      .-ooooooooooooooooo.     GPU: NVIDIA GeForce GTX 1650 Ti Mobile
      ooooooooo-             -ooooooooooooo.    Memory: 5465MiB / 15762MiB (34%)
     ooooooooo-                 .-oooooooooo.
    ooooooooo.                     -ooooooooo
    
    

    请仔细遵循 Arch Linux 桌面环境的安装 Wiki,并确保在进行切换之前检查常见问题解答,最终可能会tty不知道该怎么做。

    • 3

相关问题

  • 有没有办法让 ls 只显示某些目录的隐藏文件?

  • 使用键盘快捷键启动/停止 systemd 服务 [关闭]

  • 需要一些系统调用

  • astyle 不会更改源文件格式

  • 通过标签将根文件系统传递给linux内核

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve