在 nvidia 卡上使用 OpenGL,而不是 Intel 集成卡

在 nvidia 卡上使用 OpenGL,而不是 Intel 集成卡

我有一个可视化工作站,我通过 SSH 连接到它(应该启用 iGLX,因为我可以glxgears通过 SSH 运行),它附带了 Titan X 卡和 Matrox 适配器,我相信它是集成 Intel Iris VGA 的适配器。我使用存储库包(而不是使用运行文件)安装了最新的 CUDA。我成功编译并运行了(一些)正确执行的 CUDA 示例程序。

我遇到的问题是,在我看来,GL 应用程序不是使用 nVidia 卡上的 OpenGL 运行,而是通过集成卡运行(甚至可能使用 MESA CPU 模拟的 OpenGL)。

glxinfo| grep -i opengl
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

我还检查了它libGL.so似乎是由 MESA 安装的,而不是由 nVidia 安装的:

locate libGL
/snap/gnome-3-26-1604/64/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/snap/gnome-3-26-1604/64/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/snap/gnome-3-26-1604/70/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/snap/gnome-3-26-1604/70/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/snap/gnome-3-26-1604/74/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/snap/gnome-3-26-1604/74/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/libGL.so
/usr/lib/x86_64-linux-gnu/libGL.so.1
/usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1.0.0
/usr/lib/x86_64-linux-gnu/libGLESv1_CM_nvidia.so.1
/usr/lib/x86_64-linux-gnu/libGLESv1_CM_nvidia.so.410.79
/usr/lib/x86_64-linux-gnu/libGLESv2.so
/usr/lib/x86_64-linux-gnu/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/libGLESv2.so.2.0.0
/usr/lib/x86_64-linux-gnu/libGLESv2_nvidia.so.2
/usr/lib/x86_64-linux-gnu/libGLESv2_nvidia.so.410.79
/usr/lib/x86_64-linux-gnu/libGLU.a
/usr/lib/x86_64-linux-gnu/libGLU.so
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
/usr/lib/x86_64-linux-gnu/libGLX.so
/usr/lib/x86_64-linux-gnu/libGLX.so.0
/usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0
/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0
/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0
/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0.0.0
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.410.79
/usr/lib/x86_64-linux-gnu/libGLdispatch.so
/usr/lib/x86_64-linux-gnu/libGLdispatch.so.0
/usr/lib/x86_64-linux-gnu/libGLdispatch.so.0.0.0
/usr/local/cuda-10.0/samples/common/lib/linux/aarch64/libGLEW.a
/usr/local/cuda-10.0/samples/common/lib/linux/armv7l/libGLEW.a
/usr/local/cuda-10.0/samples/common/lib/linux/x86_64/libGLEW.a

CUDA 包不应该也安装 GL 库(并替换libGL.so?)

硬件规格

dpkg -l | grep nvidia
ii  libnvidia-cfg1-410:amd64                   410.79-0ubuntu1                              amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-410                       410.79-0ubuntu1                              all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-410:amd64                410.79-0ubuntu1                              amd64        NVIDIA libcompute package
ii  libnvidia-decode-410:amd64                 410.79-0ubuntu1                              amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-410:amd64                 410.79-0ubuntu1                              amd64        NVENC Video Encoding runtime library
ii  libnvidia-fbc1-410:amd64                   410.79-0ubuntu1                              amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-410:amd64                     410.79-0ubuntu1                              amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-410:amd64                   410.79-0ubuntu1                              amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  nvidia-compute-utils-410                   410.79-0ubuntu1                              amd64        NVIDIA compute utilities
ii  nvidia-dkms-410                            410.79-0ubuntu1                              amd64        NVIDIA DKMS package
ii  nvidia-driver-410                          410.79-0ubuntu1                              amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-410                   410.79-0ubuntu1                              amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-410                   410.79-0ubuntu1                              amd64        NVIDIA kernel source package
ii  nvidia-modprobe                            410.79-0ubuntu1                              amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-prime                               0.8.8.2                                      all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                            410.79-0ubuntu1                              amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-410                           410.79-0ubuntu1                              amd64        NVIDIA driver support binaries
ii  xserver-xorg-video-nvidia-410              410.79-0ubuntu1                              amd64        NVIDIA binary Xorg driver

CPU:英特尔(R)至强(R)银牌 4114 CPU @ 2.20GHz

lspci | grep -i vga
03:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. Integrated Matrox G200eW3 Graphics Controller (rev 04)
3b:00.0 VGA compatible controller: NVIDIA Corporation GP102 [TITAN Xp] (rev a1)
nvidia-smi 
Mon Jan 21 11:03:27 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.79       Driver Version: 410.79       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  TITAN Xp            On   | 00000000:3B:00.0 Off |                  N/A |
| 23%   30C    P8    10W / 250W |      0MiB / 12196MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

相关内容