Debian 中的硬件加速 NVidia 和 Intel 显卡一起使用

     2023-04-15     282

关键词:

【中文标题】Debian 中的硬件加速 NVidia 和 Intel 显卡一起使用【英文标题】:Hardware Accelerated NVidia and Intel Graphics Together in Debian 【发布时间】:2014-10-29 14:06:22 【问题描述】:

我想使用两个 xserver,每个都在单独的显卡上运行,实际上我正在使用两个显示器,在我的计算机上安装了两个不同的显卡,像这样:

root@ziomario-Z87-HD3:/home/ziomario# lspci -nn | grep VGA

00:02.0 VGA 兼容控制器 [0300]:英特尔公司至强 E3-1200 v3/4th Gen Core Processor 集成图形控制器 [8086:0412](修订版 06)

01:00.0 VGA 兼容控制器 [0300]:NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1)

root@ziomario-Z87-HD3:/home/ziomario# lspci -nn | grep NVIDIA

01:00.0 VGA 兼容控制器 [0300]:NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1)

01:00.1 音频设备 [0403]:NVIDIA Corporation GK106 HDMI 音频 控制器 [10de:0e0b] (rev a1)

我正在阅读这个article。

而且我已经更改了一些命令,因为他说要做的事情与我的情况之间存在差异。这就是我所做的:

使用此命令以 root 用户身份安装 NVidia 驱动程序:

./NVIDIA-Linux-x86_64-340.32.run –accept-license –no-backup –no-x-check –no-questions –ui=none –no-x-check –no-distro-scripts –utility-prefix=/nvidia –installer-prefix=/nvidia –opengl-prefix=/nvidia –opengl-libdir=glx

在 /nvidia/glx 目录中为 NVidia 创建了一个 libglx.so 链接:

ln -s /usr/lib/xorg/modules/extensions/libglx.so.295.59 libglx.so

以 root 身份创建文件夹 /etc/ld.conf.d(它以前不存在),其中包含文件:/etc/ld.conf.d/nvidia,其中两行指向新的库目录:

/nvidia/lib
/nvidia/glx

以 root 身份运行此命令以激活上述路径。

ldconfig

使用命令创建文件 /etc/X11/xorg.conf

nvidia-xconfig

使用 ModulePath 选项将 nvidia xserver 定向到正确的 Glx。将此添加到现有文件部分的 /etc/X11/xorg.conf 中,如下所示:

这是我的 xorg.conf 文件:

“服务器布局”部分

Identifier     "Layout0"
Screen      0  "Screen0"
InputDevice    "Keyboard0" "CoreKeyboard"
InputDevice    "Mouse0" "CorePointer" EndSection

“服务器布局”部分

Identifier     "Layout1"
Screen      0  "Screen1" 0 0
Option         "Xinerama" "0" EndSection

“文件”部分

modulepath "/nvidia/glx,/nvidia/lib,/usr/lib/xorg/modules" 

结束部分

“输入设备”部分

# generated from default
Identifier     "Mouse0"
Driver         "mouse"
Option         "Protocol" "auto"
Option         "Device" "/dev/psaux"
Option         "Emulate3Buttons" "no"
Option         "ZAxisMapping" "4 5" EndSection

“输入设备”部分

# generated from default
Identifier     "Keyboard0"
Driver         "kbd" EndSection

“监控”部分

Identifier     "Monitor0"
VendorName     "Unknown"
ModelName      "Unknown"
HorizSync       28.0 - 33.0
VertRefresh     43.0 - 72.0
Option         "DPMS" EndSection

“监控”部分

Identifier     "Monitor1"
VendorName     "Unknown"
Option         "DPMS" EndSection

“设备”部分

Identifier     "Device0"
Driver         "nvidia"
VendorName     "NVIDIA Corporation" EndSection

“设备”部分

Identifier     "Device1"
Driver         "intel"
BusID          "PCI:0:2:0"
Option         "AccelMethod" "uxa" EndSection

“屏幕”部分

Identifier     "Screen0"
Device         "Device0"
Monitor        "Monitor0"
DefaultDepth    24
SubSection     "Display"
    Depth       24
EndSubSection EndSection

“屏幕”部分

Identifier     "Screen1"
Device         "Device1"
Monitor        "Monitor1"
DefaultDepth    24
SubSection     "Display"
Depth       24
EndSubSection EndSection

在文件中配置用户 LD_LIBRARY_PATH 环境(这可以在 /etc/profile 和 /etc/bash.bashrc 配置文件中通用设置): ~/.profile ~/.bashrc 和 ~/.xsession 文件通过添加以下几行:

如果 [echo $DISPLAY |grep -c ":1" -eq 1];然后 导出 LD_LIBRARY_PATH=/nvidia/glx

fi

使用 Glx 重新安装了 xorg 包,以便更正以前安装 NVidia 造成的损坏:

apt-get --reinstall install glx-alternative-mesa xserver-xorg-core libgl1-mesa-glx libgl1-mesa-dri

重启Gdm3

/etc/init.d/gdm3 restart

它没有工作。与 NVIDIA 显卡相连的显示器工作正常,但另一个显示器,连接在哪里 INTEL 显卡关闭...有什么建议吗?

【问题讨论】:

【参考方案1】:

使用鼠标指针时出现空白屏幕还是空白屏幕?我有几乎相同的硬件并使用 2 个 xorg 文件,每个座位一个,lightdm 作为桌面管理器。当我在seat1(intel)上启用选项时出现问题

“服务器标志”部分 选项“自动添加设备”“假” 选项“AutoEnableDevices”“假” 结束部分

我需要这些选项来限制各自座位上的鼠标和键盘。

并在你的 xorg.conf 中检查一下:

Screen      0  "Screen1" 0 0

你确定第一个“0”没问题吗?

【讨论】:

【参考方案2】:

编辑:我在这里发布了完整的操作指南HOWTO: Intel and Nvidia accelerated on a 2 seat machine

我在 nvidia 和 intel 上使用带有 lightdm 的 multiseat(gdm3 没有给我很多选择),我的 intel 仍然没有加速(但我认为情况并非如此,因为我遇到了同样的问题,这是由错误的配置引起的) .

这是我的配置:

/etc/lightdm/lightdm.conf

[LightDM]
[SeatDefaults]
xserver-allow-tcp=false
greeter-session=lightdm-greeter
greeter-hide-users=true
session-wrapper=/etc/X11/Xsession
autologin-user=john
[XDMCPServer]
[VNCServer]
[Seat:0]                          ###nvidia
xserver-command=/usr/bin/X :0
xserver-config=xorg_seat0.conf
autologin-user=john
[Seat:1]                          ###intel
xserver-command=/usr/bin/X :1 -sharevts
xserver-config=xorg_seat1.conf
autologin-user=desk

/etc/X11/xorg_seat0.conf

Section "ServerFlags"
    Option "AllowMouseOpenFail" "on"
    Option "AllowEmptyInput" "on"
    Option "ZapWarning" "on"
    Option "HandleSpecialKeys" "off"
    Option "DRI2" "on"
    Option "Xinerama" "off"
EndSection

Section "InputClass"
    Identifier    "Disable cable keyboard"
    MatchProduct  "AT Translated Set 2 keyboard"
    Option        "Ignore" "on"
EndSection

Section "InputClass"
    Identifier    "Disable cable mouse"
    MatchProduct  "Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)"
    Option        "Ignore" "on"
EndSection

Section "ServerLayout"
    Identifier     "Seat0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-mouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
    Option         "GrabDevice" "on"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd"
    Option         "GrabDevice" "on"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "LG"
    ModelName      "LG Electronics LG TV"
    HorizSync       30.0 - 83.0
    VertRefresh     58.0 - 62.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTS 250"
    Option         "NoLogo" "1"
    BusId          "PCI:1:0:0"
    Option         "ProbeAllGpus" "false"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

/etc/X11/xorg_seat1.conf

Section "ServerFlags"
    Option "AllowMouseOpenFail" "on"
    Option "AllowEmptyInput" "on"
    Option "ZapWarning" "on"
    Option "HandleSpecialKeys" "off"
    Option "DRI2" "on"
    Option "Xinerama" "off"
EndSection

Section "InputClass"
    Identifier   "Disable Logitech wireless keyboard and mouse"
    MatchProduct "Logitech USB Receiver"
    Option       "Ignore" "on"
EndSection

Section "ServerLayout"
    Identifier     "Seat1"
    Screen      0  "Screen1" 0 0
    InputDevice    "Keyboard1" "CoreKeyboard"
    InputDevice    "Mouse1" "CorePointer"
EndSection

Section "InputDevice"
    Identifier     "Mouse1"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/by-id/usb-Microsoft_Microsoft_3-Button_Mouse_with_IntelliEye_TM_-event-mouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
    Option         "GrabDevice" "on"
EndSection

Section "InputDevice"
    Identifier     "Keyboard1"
    Driver         "kbd"
    Option         "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
    Option         "GrabDevice" "on"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "LG"
    ModelName      "LG Electronics W2042"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "intel"
    VendorName     "Intel Corporation"
    BoardName      "Intel 82G31"
    BusID          "PCI:0:2:0"
    Screen         0
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    SubSection     "Display"
        Depth       24
    Modes       "1680x1050"
    EndSubSection
EndSection

要查找 /dev/input/by-path/ 使用

ls -la /dev/input/by-path

要查找 /dev/input/by-id/ 使用

ls -la /dev/input/by-id

(最好使用 /dev/input/by-id/... 除非您有 ps2 键盘或鼠标。然后使用 /dev/input/by-path...)

要查找键盘和鼠标的 MatchProduct 值,请在“活动”xsession 上使用 xinput,而不是在裸控制台上。

sudo apt-get install xinput
xinput

接下来的几个小时我会按照你的描述尝试加速我的英特尔卡,所以我会提供更多信息:)

【讨论】:

【参考方案3】:

这可能是一个http://unix.stackexchange.com 问题...

根据您要完成的任务,运行 2 个 x-server 可以解决使用一个 GPU 驱动一台显示器并使用另一个 GPU 驱动另一台显示器的问题,但也会产生另一组问题:您将无法在一个和另一个监视器之间移动应用程序等,...

两张卡都需要一个公共帧缓冲区来驱动一个公共桌面以让某些应用程序运行一张卡或另一张卡,这就是bumblebee project 正在为您做的事情。 NVidia 专有驱动程序和 bumblebee 二进制文件都位于安装 xorg.edgers PPA 中。

由于 xorg.edgers 小组要求不要在没有链接到他们的页面的情况下直接给出安装说明,这是我现在能做的最好的...

如果您不知道 PPA 是什么,或者在阅读了他们的页面后需要一些有关向前和向后滚动驱动程序版本的指导,请在下方发表评论。

公平警告:我是一名 Ubuntu 杂种用户,而不是纯种 Debian 用户,但他们已经足够接近,以至于他们的解决方案可能仍会杂交。 ;-)

【讨论】:

ffmpeg使用硬件加速hwaccelcuvidh264_cuvidh264_nvenc(代码片段)

...缩放题外话,如何使用scale_npp简单分析一下ffmpeg源码中的硬件加速部分参考网站ffmpeg支持硬件加速的原理ffmpeg的硬件加速原理大概就是采用硬件对编解码进行处理,硬件有转码进行解码的sdk,比如nvidia的sdk等所用环境... 查看详情

cnn卷积神经网络加速和实际在硬件中的计算过程(代码片段)

2维卷积操作,多通道多输出的卷积示意图关于图像的解释说明输入FeatureMap维度W×H×CinW\\timesH\\timesC_inW×H×Cin​卷积核Kernel维度WK×HK×Cin×CoutW_K\\timesH_K\\timesC_in\\timesC_outWK​×HK​×Cin​×Cout​输出FeatureMap维度W×H×CoutW\\timesH\\time 查看详情

使用gpu硬件加速ffmpeg视频转码(代码片段)

...安装在FFmpeg官网https://ffmpeg.org/download.html可以下载到ubunto/debian的发行包,其他Linux发行版需自行编译。同时,如果要使用GPU进行硬件加速的话,也是必须自己编译FFmpeg的,所以本节将介绍从源码编译安装FFmpeg的方法(基于RHEL/Cento... 查看详情

测量 NVIDIA 张量核心加速

...量核心对我的代码的影响(用于测试目的的Tensorflow/Python中的卷积神经网络)。如何测量张量核心加速?是否可以禁用张量核心并在有/没有它们的情况下运行相同的代码?我尝试过 查看详情

GPU Context是啥意思,NVIDIA架构中的GPU硬件通道

】GPUContext是啥意思,NVIDIA架构中的GPU硬件通道【英文标题】:whatismeantbyGPUContext,GPUhardwarechannelinNVIDIA\'SarchitectureGPUContext是什么意思,NVIDIA架构中的GPU硬件通道【发布时间】:2014-05-3000:55:06【问题描述】:在阅读一些与GPU计算相... 查看详情

Android ffmpeg 和硬件加速

...问题描述】:我希望我的视频流应用程序能够利用android中的硬件加速。我仅限于udp视频广播所以我不能使用Android媒体播放器,所以我打算使用ffmpeg。有没有办法让ffmpeg在android上使用硬件加速?【问题讨论】:我有类似的问题,... 查看详情

ffmpeg使用硬件加速hwaccelcuvidh264_cuvidh264_nvenc(代码片段)

...缩放题外话,如何使用scale_npp简单分析一下ffmpeg源码中的硬件加速部分参考网站 查看详情

html5硬件中的canvas元素是不是加速?

】html5硬件中的canvas元素是不是加速?【英文标题】:Iscanvaselementinhtml5hardwareaccelerated?html5硬件中的canvas元素是否加速?【发布时间】:2015-12-2506:16:42【问题描述】:我对Web开发还很陌生,实际上我正在考虑深入研究html和js进行... 查看详情

debian10安装nvidia显卡驱动

参考技术ADebian官方的参考地址 | LinuxConfig参考地址步骤:安装显卡的驱动检查程序->根据提示安装驱动包->重启进入!这里要注意的坑是:如果你是和Gnome桌面,有可能进不去。其实驱动已经成功安装。你可以ctrl+alt+f2... 查看详情

ffmpeg 的硬件加速不起作用

】ffmpeg的硬件加速不起作用【英文标题】:hardwareaccelerationforffmpegisnotworking【发布时间】:2020-03-1712:40:11【问题描述】:我为我的nvidia下载了cuda驱动程序但它仍然不使用我的GPU,它仍然使用cpu。我怎样才能让它使用GPU。我也听说... 查看详情

Nvidia 和 AMD 硬件上的 OpenCL FFT?

】Nvidia和AMD硬件上的OpenCLFFT?【英文标题】:OpenCLFFTonbothNvidiaandAMDhardware?【发布时间】:2012-07-0311:49:35【问题描述】:我正在开展一个需要在Nvidia和AMD显卡上使用FFT的项目。我最初寻找一个可以同时在两者上工作的库(认为这将... 查看详情

debian上怎么装驱动

Ubuntu自带的硬件驱动小程序名叫jockey-gtk,Debian没有(或许可以移植,没试过,不知道行不行),它所做的事情是把命令图形化,方便新手安装驱动。通过它安装的驱动是闭源驱动,nvidia显卡对应可以装nvidia-glx(最近发现xserver-xo... 查看详情

nvidia/cuda公开源中的devel和runtime有啥区别

从很多方面来看,CUDA和OpenCL的关系都和DirectX与OpenGL的关系很相像。如同DirectX和OpenGL一样,CUDA和OpenCL中,前者是配备完整工具包、针对单一供应商(NVIDIA)的成熟的开发平台,后者是一个开放的标准。虽然两者抱着相同的目标:通... 查看详情

我可以使用 NVIDIA nsight 对 WPF 性能进行故障排除吗?

...DIAnsight来查看WPF正在做什么,但设置文档说我应该禁用WPF硬件加速。在不禁用硬件加速的情况下,我仍然可以获得结果,但现在我不确定- 查看详情

如何在非 NVIDIA 设置上加速深度学习?

】如何在非NVIDIA设置上加速深度学习?【英文标题】:HowcanIspeedupdeeplearningonanon-NVIDIAsetup?【发布时间】:2017-08-2520:42:03【问题描述】:由于我只有AMDA10-7850APU,并且没有资金购买800至1200美元的NVIDIA显卡,因此我正在努力利用现有... 查看详情

CSS 过渡不适用于 chrome 45 中的 scale(0) + 硬件加速?

】CSS过渡不适用于chrome45中的scale(0)+硬件加速?【英文标题】:CSStransitionnotworkingwithscale(0)+hardwareaccelerationinchrome45?【发布时间】:2015-12-1120:29:38【问题描述】:当硬件加速被激活(通过will-change或translateZ(0))并且您在chrome45中与s... 查看详情

gstreamer中的视频处理与硬件加速

...发工作。曾参与过X11、Xorg中driver的开发,也做过mesa中的3Ddriver,后来也做过一些GPU相关的OpenCL的研发。近几年主要在为Gstreamer提供英特尔GPU相关的video编解码加速插件。目前,我也是Gstreamer社区里的maintainer之一。本... 查看详情

nvidia发布更快功耗更低的新一代图形加速卡

...或许是其中最有趣的:一张更快、功耗更低的新一代图形加速卡。多名与会者与多个新闻站点发现了这点,Nvidia向我证实这确实是一张新卡。Nvidia的“Volta”这代TeslaGPU加速卡在2017年就已淘汰,因此升级工作应该早已过期... 查看详情