- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 NVIDIA GPU 为 OpenGL headless (headless)应用程序创建运行 X 服务器的 Docker 镜像。 (可用于创建纹理、在无屏幕的情况下运行 Unity3D 等)。在这种情况下,主机没有运行 X 服务器,我想在容器内做所有事情。
我将这个 Dockerfile 用于图像:
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libgles2 \
xserver-xorg-video-nvidia-440
COPY xorg.conf.nvidia-headless /etc/X11/xorg.conf
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics
ENV DISPLAY :1
ENTRYPOINT ["/bin/bash"]
对于 xorg.config.nvidia-headless,我使用 nvidia-xconfig 创建了它
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
EndSection
Section "Files"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "UseDisplayDevice" "None"
SubSection "Display"
Virtual 1920 1080
Depth 24
EndSubSection
EndSection
我使用 --privileged 和 --gpus 运行 docker,全部使用 nvidia-docker 并共享设备 --device --device=/dev/dri/card0。在 Docker 内部,我可以完美地运行 nvidia-smi。
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xserver.log vt1 :1
但它显示一个错误:
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
这是完整的日志:
X.Org X Server 1.19.6
Release Date: 2017-12-20
[ 1296.109] X Protocol Version 11, Revision 0
[ 1296.109] Build Operating System: Linux 4.4.0-168-generic x86_64 Ubuntu
[ 1296.109] Current Operating System: Linux ubuntu 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64
[ 1296.109] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-112-generic root=UUID=8f2dc01d-1666-4abd-9bd1-cfe0a20afdf1 ro splash quiet vt.handoff=1
[ 1296.109] Build Date: 14 November 2019 06:20:00PM
[ 1296.109] xorg-server 2:1.19.6-1ubuntu4.4 (For technical support please see http://www.ubuntu.com/support)
[ 1296.109] Current version of pixman: 0.34.0
[ 1296.109] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 1296.109] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 1296.110] (++) Log file: "./xserver.log", Time: Wed Aug 19 08:38:46 2020
[ 1296.110] (==) Using config file: "/etc/X11/xorg.conf"
[ 1296.110] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 1296.111] (==) ServerLayout "Layout0"
[ 1296.111] (**) |-->Screen "Screen0" (0)
[ 1296.111] (**) | |-->Monitor "Monitor0"
[ 1296.112] (**) | |-->Device "Device0"
[ 1296.112] (**) |-->Input Device "Keyboard0"
[ 1296.112] (**) |-->Input Device "Mouse0"
[ 1296.112] (==) Automatically adding devices
[ 1296.112] (==) Automatically enabling devices
[ 1296.112] (==) Automatically adding GPU devices
[ 1296.112] (==) Automatically binding GPU devices
[ 1296.112] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 1296.114] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 1296.114] Entry deleted from font path.
[ 1296.114] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[ 1296.114] Entry deleted from font path.
[ 1296.114] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[ 1296.114] Entry deleted from font path.
[ 1296.114] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[ 1296.114] Entry deleted from font path.
[ 1296.114] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[ 1296.114] Entry deleted from font path.
[ 1296.114] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 1296.114] Entry deleted from font path.
[ 1296.114] (==) FontPath set to:
/usr/share/fonts/X11/misc,
built-ins
[ 1296.114] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 1296.114] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 1296.114] (WW) Disabling Keyboard0
[ 1296.114] (WW) Disabling Mouse0
[ 1296.115] (II) Loader magic: 0x55dca9edc020
[ 1296.115] (II) Module ABI versions:
[ 1296.115] X.Org ANSI C Emulation: 0.4
[ 1296.115] X.Org Video Driver: 23.0
[ 1296.115] X.Org XInput driver : 24.1
[ 1296.115] X.Org Server Extension : 10.0
[ 1296.116] (EE) dbus-core: error connecting to system bus: org.freedesktop.DBus.Error.FileNotFound (Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory)
[ 1296.116] (++) using VT number 1
[ 1296.116] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 1296.116] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 1296.119] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules"
[ 1296.122] (--) PCI:*(0:1:0:0) 10de:100c:1043:84b7 rev 161, Mem @ 0xf9000000/16777216, 0xd0000000/134217728, 0xd8000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[ 1296.122] (II) LoadModule: "glx"
[ 1296.123] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 1296.131] (EE) Failed to load /usr/lib/xorg/modules/extensions/libglx.so: /usr/lib/xorg/modules/extensions/libglx.so: undefined symbol: glxServer
[ 1296.131] (II) UnloadModule: "glx"
[ 1296.131] (II) Unloading glx
[ 1296.131] (EE) Failed to load module "glx" (loader failed, 7)
[ 1296.131] (II) LoadModule: "nvidia"
[ 1296.131] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so
[ 1296.138] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 1296.139] compiled for 1.6.99.901, module version = 1.0.0
[ 1296.139] Module class: X.Org Video Driver
[ 1296.140] (II) NVIDIA dlloader X Driver 440.100 Fri May 29 08:21:27 UTC 2020
[ 1296.140] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 1296.141] (II) Loading sub module "fb"
[ 1296.141] (II) LoadModule: "fb"
[ 1296.141] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 1296.143] (II) Module fb: vendor="X.Org Foundation"
[ 1296.143] compiled for 1.19.6, module version = 1.0.0
[ 1296.143] ABI class: X.Org ANSI C Emulation, version 0.4
[ 1296.143] (II) Loading sub module "wfb"
[ 1296.143] (II) LoadModule: "wfb"
[ 1296.143] (II) Loading /usr/lib/xorg/modules/libwfb.so
[ 1296.144] (II) Module wfb: vendor="X.Org Foundation"
[ 1296.144] compiled for 1.19.6, module version = 1.0.0
[ 1296.144] ABI class: X.Org ANSI C Emulation, version 0.4
[ 1296.144] (II) Loading sub module "ramdac"
[ 1296.144] (II) LoadModule: "ramdac"
[ 1296.144] (II) Module "ramdac" already built-in
[ 1296.145] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[ 1296.145] (EE) NVIDIA: system's kernel log for additional error messages and
[ 1296.145] (EE) NVIDIA: consult the NVIDIA README for details.
[ 1296.145] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[ 1296.145] (EE) NVIDIA: system's kernel log for additional error messages and
[ 1296.145] (EE) NVIDIA: consult the NVIDIA README for details.
[ 1296.145] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[ 1296.145] (EE) NVIDIA: system's kernel log for additional error messages and
[ 1296.145] (EE) NVIDIA: consult the NVIDIA README for details.
[ 1296.145] (EE) No devices detected.
[ 1296.145] (II) Applying OutputClass "nvidia" to /dev/dri/card0
[ 1296.145] loading driver: nvidia
[ 1296.145] (==) Matched nvidia as autoconfigured driver 0
[ 1296.145] (==) Matched nouveau as autoconfigured driver 1
[ 1296.145] (==) Matched nouveau as autoconfigured driver 2
[ 1296.145] (==) Matched modesetting as autoconfigured driver 3
[ 1296.145] (==) Matched fbdev as autoconfigured driver 4
[ 1296.145] (==) Matched vesa as autoconfigured driver 5
[ 1296.145] (==) Assigned the driver to the xf86ConfigLayout
[ 1296.145] (II) LoadModule: "nvidia"
[ 1296.145] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so
[ 1296.145] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 1296.145] compiled for 1.6.99.901, module version = 1.0.0
[ 1296.145] Module class: X.Org Video Driver
[ 1296.145] (II) UnloadModule: "nvidia"
[ 1296.145] (II) Unloading nvidia
[ 1296.145] (II) Failed to load module "nvidia" (already loaded, 21980)
[ 1296.145] (II) LoadModule: "nouveau"
[ 1296.146] (WW) Warning, couldn't open module nouveau
[ 1296.146] (II) UnloadModule: "nouveau"
[ 1296.146] (II) Unloading nouveau
[ 1296.146] (EE) Failed to load module "nouveau" (module does not exist, 0)
[ 1296.146] (II) LoadModule: "modesetting"
[ 1296.146] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[ 1296.147] (II) Module modesetting: vendor="X.Org Foundation"
[ 1296.147] compiled for 1.19.6, module version = 1.19.6
[ 1296.147] Module class: X.Org Video Driver
[ 1296.147] ABI class: X.Org Video Driver, version 23.0
[ 1296.147] (II) LoadModule: "fbdev"
[ 1296.147] (WW) Warning, couldn't open module fbdev
[ 1296.147] (II) UnloadModule: "fbdev"
[ 1296.147] (II) Unloading fbdev
[ 1296.147] (EE) Failed to load module "fbdev" (module does not exist, 0)
[ 1296.147] (II) LoadModule: "vesa"
[ 1296.147] (WW) Warning, couldn't open module vesa
[ 1296.147] (II) UnloadModule: "vesa"
[ 1296.147] (II) Unloading vesa
[ 1296.147] (EE) Failed to load module "vesa" (module does not exist, 0)
[ 1296.147] (II) NVIDIA dlloader X Driver 440.100 Fri May 29 08:21:27 UTC 2020
[ 1296.147] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 1296.147] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[ 1296.147] (WW) xf86OpenConsole: setpgid failed: Operation not permitted
[ 1296.147] (WW) xf86OpenConsole: setsid failed: Operation not permitted
[ 1296.147] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[ 1296.147] (EE) NVIDIA: system's kernel log for additional error messages and
[ 1296.147] (EE) NVIDIA: consult the NVIDIA README for details.
[ 1296.147] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[ 1296.147] (EE) NVIDIA: system's kernel log for additional error messages and
[ 1296.147] (EE) NVIDIA: consult the NVIDIA README for details.
[ 1296.147] (WW) Falling back to old probe method for modesetting
[ 1296.147] (EE) Screen 0 deleted because of no matching config section.
[ 1296.147] (II) UnloadModule: "modesetting"
[ 1296.147] (EE) Device(s) detected, but none match those in the config file.
[ 1296.147] (EE)
Fatal server error:
[ 1296.147] (EE) no screens found(EE)
[ 1296.147] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 1296.147] (EE) Please also check the log file at "./xserver.log" for additional information.
[ 1296.147] (EE)
[ 1296.149] (EE) Server terminated with error (1). Closing log file.
有人可以帮我吗?这将在带有 NVIDIA GPU 的 headless (headless)机器上运行。
最佳答案
首先要做的事情:如果你想要 headless (headless) OpenGL,不要使用 X 服务器!
X 服务器需要与 GPU 通信已经有好几年了。如果没有,您可以很好地进行 headless (headless)渲染。 Nvidia 有一篇关于如何做到这一点的好文章:https://developer.nvidia.com/blog/egl-eye-opengl-visualization-without-x-server/
要点是,您使用 EGL 来设置上下文并通过调用 eglMakeCurrent(eglDpy, EGL_NO_SURFACE, EGL_NO_SURFACE, eglCtx);
使上下文在没有表面的情况下成为当前上下文。 .
您仍然需要用于 Xorg 的 Nvidia 驱动程序,因为它还带有所有屏幕外的东西,但有一个重要的警告:Nvidia 用户区驱动程序必须匹配主机系统 nvidia
内核模块版本。如果您将驱动程序包装在 Docker 容器中,您实际上是将 Docker 镜像绑定(bind)到主机系统上的特定内核模块版本。不是一个理想的情况。相反,您应该配置您的 docker 镜像以从主机系统绑定(bind)驱动程序和 OpenGL 实现库。不幸的是,这些库和驱动程序的位置没有通用的位置,这意味着需要更多的努力才能将它们全部可靠地拉入。但不要绝望,Nvidia 已经为您完成了这项工作:
https://gitlab.com/nvidia/container-images/opengl
此外,为了可靠地设置屏幕外上下文,取消设置 DISPLAY
也很有帮助。变量:由于 Nvidia 刚刚在 Xorg 驱动程序之上构建了他们所有的 Vulkan 和 EGL 东西,所以有一些代码路径会评估该变量并取消设置它有助于将所有代码路径推向正确的方向。因此,在您的程序中,在设置 OpenGL 上下文之前执行 setenv("DISPLAY", NULL, 0)
.
关于用于 NVIDIA opengl 应用程序的 Docker xserver(主机中没有 X),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63483222/
我在这里想做的是将所有连接转发到机器一上端口 3306 上的本地主机到本地主机上端口 3306 上的机器二。因此,如果您连接到机器一上的 mysql,它的行为就像您正在连接一样在二号机器上。 我认为
通过Kibana界面,如何获得 flex IP /主机? 我的意思是,与kibana连接的Elastic主机。 那有可能吗?我在这个上挣扎了好几个小时,却一无所获:( 附:不确定此问题是否是题外话,应
我知道这听起来很奇怪,但我有一个情况,Deno 需要关闭自己的主机(并因此杀死自己的进程)。这可能吗? 我特别需要这个用于 linux (lubuntu),如果相关的话。我想这需要 sudo 权限,这
我知道这听起来很奇怪,但我有一个情况,Deno 需要关闭自己的主机(并因此杀死自己的进程)。这可能吗? 我特别需要这个用于 linux (lubuntu),如果相关的话。我想这需要 sudo 权限,这
我有一个基本问题,但谷歌并没有为我产生很多结果(反正不是英文的)。基本上我想做的就是: 我有一个图形需要用作整个应用程序的持久 header ,例如:我不能让它在新的 Intent 调用时从屏幕上滑出
您好,我正在使用 xampp,我正在尝试使用 php 进行连接。 $sql_connections = mysql_connect("$server, $username, $password")
我目前正在尝试一些多人游戏的想法,并正在尝试创建一个 Java 应用程序来为基于网络浏览器的多人游戏提供服务。 我的开发环境是主机上的Eclipse, native 上的notepad + Googl
今天为大家分享一篇关于SSH 的介绍和使用方法的文章。本文从SSH是什么出发,讲述了SSH的基本用法,之后在远程登录、端口转发等多种场景下进行独立的讲述,希望能对大家有所帮助。 什么是SSH?
我已经完成了在裸机 Centos 7 上运行的测试 Kubernets 主机的设置。这将用作测试系统,因为我们将在 IBM Bluemix Kubernetes 服务中部署所有内容。 从 Bluemi
我正在尝试通过带有 4.2(果冻 bean )的 android 设备“nexus 7”通过 USB 与我的 freeduino 板进行通信,该板类似于 arduino uno。 几个月后,我使用开发
我正在使用 nginx,但在设置反向代理时遇到问题。 我的 nginx.conf 是默认的(没有对其进行任何更改),我的站点可用配置是: upstream backend_hosts { se
我在 projectlocker(免费 svn 主机)上有一个帐户,但我不知道如何将我的项目文件上传到它。 我在我的仪表板中找不到任何选项。 我在我的电脑上使用tortoiseSvn,那么如何上传文件
设置batchSize = 1有意义吗?如果我想一次处理一个文件? 尝试过batchSize = 1000和batchSize = 1 - 似乎具有相同的效果 { "version": "2.0"
我只想知道.. docker中现在有任何可用的工具吗?我已经阅读了Docker中有关多主机功能的一些文档,例如, Docker群 Docker服务(带有副本) 我也知道群模式下的volume问题,容器
我想将文件从 Docker 的容器挂载到我的 docker 主机。 数据卷不是我的解决方案,因为它们是从 docker 主机到 docker 容器的装载,我需要相反的方法。 谢谢 最佳答案 当 doc
我是新手。我无法正确理解RMI。互联网上有大量教程,但据我所知,它们都是针对本地主机的。服务器和客户端都运行在同一台机器上。 我想在任何计算机上运行客户端,并且主机将位于一台计算机上,让我们考虑IP
我无法从客户端“A”SSH 到服务器“B”(但我可以从同一子网上的许多其他 ssh 客户端而不是“A”——所有都是 *nux 机器) serverA>ssh -v -p 端口用户@serverB Op
设置batchSize = 1有意义吗?如果我想一次处理一个文件? 尝试过batchSize = 1000和batchSize = 1 - 似乎具有相同的效果 { "version": "2.0"
由于我不是天生的编码员,请多多包涵。 这是我尝试使用HAproxy来实现的目标,但是经过数小时的检查后,我无法以某种方式使其工作。 从 domain.com/alpha domain.com/beta
我正在使用 tomcat 运行 Java Web 应用程序,通过电子邮件将生成的报告发送给用户。我可以发送电子邮件,但几个小时后服务器停止发送电子邮件,并出现以下错误。 javax.mail.Mess
我是一名优秀的程序员,十分优秀!