双GPU设置:在Intel集成GPU上运行Xorg,使用NVIDIA GPU进行游戏。

huangapple go评论75阅读模式
英文:

Dual GPU Setup: Xorg on Intel Integrated GPU, NVIDIA GPU for Gaming

问题

我最近购买了一台新笔记本电脑,并在其中安装了openSUSE Tumbleweed。该笔记本配备有英特尔Core i5处理器,集成显卡和一颗NVIDIA 3050 Ti独立显卡。我的目标是配置Xorg以在集成显卡上运行,并在不需要时禁用NVIDIA显卡。为了实现这一目标,我使用了prime-select通过运行命令sudo prime-select offload来设置离线模式。

然而,我遇到了一个问题,Xorg仍然在NVIDIA显卡上运行。当我检查nvidia-smi的输出时,我收到了以下信息:

Sun May 28 10:00:02 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.116.04   驱动程序版本: 525.116.04   CUDA 版本: 12.0          |
|-------------------------------+----------------------+----------------------+
| GPU  名称          持续性-M| 总线-Id        Disp.A | 不稳定的 ECC          |
| 风扇   温度   性能   功率: 使用/Cap|         显存使用            | GPU-利用率     计算M. |
|                                    |                                      |              MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...    禁用   | 00000000:01:00.0 禁用 |                无      |
| N/A     42C    P8       6W /  30W |       5MiB /  4096MiB |       0%         默认   |
|                                    |                                      |                无      |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| 进程:                                                                        |
|  GPU   GI   CI          PID   类型   进程名称                        GPU内存 |
|           ID   ID                                                     使用量      |
|=============================================================================|
|     0    N/A  N/A        3246        G     /usr/bin/Xorg.bin           4MiB  |
+-----------------------------------------------------------------------------+

此外,当我检查任务管理器时,它显示Xorg不应该在NVIDIA显卡上运行。我查看了位于/etc/X11/xorg.confxorg.conf文件,并包含以下配置:

Section "ServerLayout"
    Identifier "layout"
    Screen "intel"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "ServerFlags"
    Option "AutoAddGPU" "false"
EndSection

# NVIDIA PRIME渲染卸载所需
Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
EndSection

如果缺少任何必要信息,我为此道歉。如果您需要任何其他细节,请告诉我。这是我第一次使用显卡,所以我将不胜感激地接受任何指导。

英文:

I recently purchased a new laptop and installed openSUSE Tumbleweed on it. The laptop has an Intel Core i5 processor with integrated graphics and an NVIDIA 3050 Ti. My goal is to configure Xorg to run on the integrated GPU and disable the NVIDIA GPU when it's not required. To achieve this, I used prime-select to set the offload mode by running the command sudo prime-select offload.

However, I encountered a problem where Xorg is still running on the NVIDIA GPU. When I checked the output of nvidia-smi, I received the following information:

Sun May 28 10:00:02 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.116.04   Driver Version: 525.116.04   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   42C    P8     6W /  30W |      5MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3246      G   /usr/bin/Xorg.bin                   4MiB |
+-----------------------------------------------------------------------------+

Additionally, when I checked the task manager, it indicated that Xorg should not be running on the NVIDIA GPU. I have examined the xorg.conf file located at /etc/X11/xorg.conf and it contains the following configuration:

Section "ServerLayout"
    Identifier "layout"
    Screen "intel"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "ServerFlags"
    Option "AutoAddGPU" "false"
EndSection

# needed for NVIDIA PRIME Render Offload
Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
EndSection

I apologize if any necessary information is missing. Please let me know if you require any additional details. This is my first time working with a graphics card, so any guidance would be appreciated.

答案1

得分: 0

OHHHHHH, YESSSSS. I SOLVED IT! 我解决了!I simply added GPUDevice "intel" to the xorg.conf file! 我只是在xorg.conf文件中添加了GPUDevice "intel"!Now there are no proceses running on the NVIDIA GPU! 现在没有进程在NVIDIA GPU上运行了!It doesn't go into low power state but I think I will figure it out. 它没有进入低功耗状态,但我想我会解决它的。

Thanks to @VonC! 感谢@VonC!I saw it in the logs that it used nvidia as the GPUDevice. 我在日志中看到它使用nvidia作为GPUDevice。

Edit: 编辑:
I eventually got the PRIME offloading working thanks to this tutorial: https://wiki.archlinux.org/title/PRIME
最终,我通过这个教程成功使用了PRIME离屏渲染:https://wiki.archlinux.org/title/PRIME

英文:

OHHHHHH, YESSSSS. I SOLVED IT! I simply added GPUDevice "intel" to the xorg.conf file! Now there are no proceses running on the NVIDIA GPU! It doesn't go into low power state but I think I will figure it out.

Thanks to @VonC! I saw it in the logs that it used nvidia as the GPUDevice.

Edit:
I eventually got the PRIME offloading working thanks to this tutorial: https://wiki.archlinux.org/title/PRIME

答案2

得分: 0

我只是在 xorg.conf 文件中添加了 GPUDevice "intel"!

xorg.conf 文件的 Screen 部分中,GPUDevice 选项指定了X服务器应将哪个GPU用作主要GPU。
通过设置 GPUDevice "intel",您正在指示X服务器使用集成的Intel GPU作为主要设备。

PRIME offload 设置 中,主要GPU(在这种情况下为Intel GPU)用于运行X服务器和大多数应用程序,而次要GPU(NVIDIA GPU)仅用于需要更多图形性能的特定应用程序。
通过将Intel GPU设置为主要设备,您确保X服务器和大多数应用程序在Intel GPU上运行,这很可能是您不再看到任何进程在NVIDIA GPU上运行的原因。

请注意,NVIDIA驱动程序会保持GPU处于准备好处理GPU加速请求的状态,因此即使未主动使用,它可能不会进入低功耗状态。

英文:

> I simply added GPUDevice "intel" to the xorg.conf file!

The GPUDevice option in the Screen section of the xorg.conf file specifies which GPU should be used as the primary GPU by the X server.
By setting GPUDevice "intel", you are instructing the X server to use the integrated Intel GPU as the primary device.

In a PRIME offload setup, the primary GPU (in this case, the Intel GPU) is used for running the X server and most applications, while the secondary GPU (the NVIDIA GPU) is used only for specific applications that require more graphics power.
By setting the Intel GPU as the primary device, you are ensuring that the X server and most applications run on the Intel GPU, which is likely why you are no longer seeing any processes running on the NVIDIA GPU.

Note, the NVIDIA driver keeps the GPU ready to handle requests for GPU acceleration, so it might not go into a low power state even when it is not actively being used.

huangapple
  • 本文由 发表于 2023年5月28日 16:10:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76350531.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定