【问题标题】:webots can not use 3090 gpu in docker container through X11 forwardingwebots 无法通过 X11 转发在 docker 容器中使用 3090 gpu
【发布时间】:2023-02-15 17:52:27
【问题描述】:

我使用 X11 转发在具有 3090 GPU 的远程服务器上启动 webots,我已经在该服务器上安装了 Nvidia GPU 驱动程序,但是,当我启动 webots 时,它说 GPU 不符合要求,因为 opengl 使用 Mesa/X.org .如何解决这个问题?

 > glxinfo | grep OpenGL
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 15.0.6, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 22.2.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5 (Compatibility Profile) Mesa 22.2.5
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.2.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

glx信息 | grep OpenGL 应该显示 nvidia 卡

【问题讨论】:

  • 您的问题中不清楚 glxinfo 是从本机还是从 docker 运行。如果从 docker 运行,请解释如何运行 docker。您是否按照here提供的说明进行操作?
  • @OlivierMichel 我已经在 docker 和本地机器上运行了它
  • 请更正您的问题,以便清楚您的glxinfo 命令的输出来自哪里(docker 容器或主机)。
  • @OlivierMichel docker 容器,在主机上显示 nvidia 卡

标签: webots


【解决方案1】:

实际上,您应该在主机和 docker 容器内获取 NVIDIA 驱动程序。

以下是要遵循的程序:

  1. 确保您在主机上安装了 NVIDIA 驱动程序:glxinfo | grep OpenGL 应该会生成如下内容:
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2
    OpenGL core profile version string: 4.6.0 NVIDIA 525.78.01
    OpenGL core profile shading language version string: 4.60 NVIDIA
    OpenGL core profile context flags: (none)
    OpenGL core profile profile mask: core profile
    OpenGL core profile extensions:
    OpenGL version string: 4.6.0 NVIDIA 525.78.01
    OpenGL shading language version string: 4.60 NVIDIA
    OpenGL context flags: (none)
    OpenGL profile mask: (none)
    OpenGL extensions:
    OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 525.78.01
    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    OpenGL ES profile extensions:
    
    1. 使用位于空目录中的以下 Dockerfile 创建一个 docker 容器:
    FROM cyberbotics/webots.cloud:R2023a-ubuntu20.04
    RUN apt-get update && apt-get install -y mesa-utils
    

    (如果需要,您可以使用不同的 Webots 图像)

    1. 转到此目录并构建 docker 镜像:docker build --tag webots-glxinfo .

    2. 运行它:docker run --tty --rm --gpus=all --env DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix:rw -it webots-glxinfo

    3. 输入以下命令:

    # glxinfo | grep OpenGL
    
    1. 您应该得到以下输出:
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2
    OpenGL core profile version string: 4.6.0 NVIDIA 525.78.01
    OpenGL core profile shading language version string: 4.60 NVIDIA
    OpenGL core profile context flags: (none)
    OpenGL core profile profile mask: core profile
    OpenGL core profile extensions:
    OpenGL version string: 4.6.0 NVIDIA 525.78.01
    OpenGL shading language version string: 4.60 NVIDIA
    OpenGL context flags: (none)
    OpenGL profile mask: (none)
    OpenGL extensions:
    OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 525.78.01
    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    OpenGL ES profile extensions:
    

    这基本上与主机上的输出完全相同。

【讨论】:

    猜你喜欢
    • 2017-09-22
    • 2017-06-30
    • 1970-01-01
    • 2021-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-30
    • 1970-01-01
    相关资源
    最近更新 更多