OpenGL uses the Mesa implementation not the NVIDIA

Dear all,

I want to use OptiX therefore I need the NVIDIA implementation of the OpenGL and it turns out I am using Mesa implementation. I know there are already a lot of post for this, but I tried to reinstall the driver or tried to use the prime-select to nvidia, or tried to change it in the control panel. None of them works, can anyone help me?

The basic information is:
Operating system: Ubuntu 20.04 LTS

Output of nvidia smi:
Tue Jun 28 15:54:00 2022
±----------------------------------------------------------------------------+
| NVIDIA-SMI 510.73.05 Driver Version: 510.73.05 CUDA Version: 11.6 |
|-------------------------------±---------------------±---------------------+
| 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 RTX A6000 Off | 00000000:01:00.0 Off | Off |
| 30% 33C P8 16W / 300W | 6MiB / 49140MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

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

Output of lshw -class display:
WARNING: you should run this program as super-user.
*-display
description: VGA compatible controller
product: NVIDIA Corporation
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: iomemory:2000-1fff iomemory:2000-1fff irq:183 memory:f6000000-f6ffffff memory:20090000000-2009fffffff memory:200a0000000-200a1ffffff ioport:3000(size=128) memory:f7000000-f707ffff
*-display
description: VGA compatible controller
product: ASPEED Graphics Family
vendor: ASPEED Technology, Inc.
physical id: 0
bus info: pci@0000:69:00.0
version: 52
width: 32 bits
clock: 33MHz
capabilities: vga_controller cap_list rom
configuration: driver=ast latency=0
resources: irq:181 memory:c9000000-c9ffffff memory:ca000000-ca03ffff ioport:e000(size=128) memory:c0000-dffff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.

Output of lspci | grep -i vga: (I know I have two graphics and opengl seems to use the ASPEED one)
01:00.0 VGA compatible controller: NVIDIA Corporation Device 2230 (rev a1)
69:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 52)

Output of sudo prime-select query: (I have made it to nvidia, before it was on-demand)
nvidia

Output of nvidia-settings: (And a blank window of NVIDIA X Server Settings pops out)

ERROR: Unable to load info from any available system

(nvidia-settings:44901): GLib-GObject-CRITICAL **: 15:55:14.096: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
** Message: 15:55:14.098: PRIME: No offloading required. Abort
** Message: 15:55:14.098: PRIME: is it supported? no

xorg.config file content:

nvidia-xconfig: X configuration file generated by nvidia-xconfig

nvidia-xconfig: version 510.73.05

Section “ServerLayout”
Identifier “Layout0”
Screen 0 “Screen0”
InputDevice “Keyboard0” “CoreKeyboard”
InputDevice “Mouse0” “CorePointer”
EndSection

Section “Files”
EndSection

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

Section “InputDevice”
# generated from default
Identifier “Keyboard0”
Driver “kbd”
EndSection

Section “Monitor”
Identifier “Monitor0”
VendorName “Unknown”
ModelName “Unknown”
Option “DPMS”
EndSection

Section “Device”
Identifier “Device0”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BusID “PCI:1:0:0”
EndSection

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
SubSection “Display”
Depth 24
EndSubSection
EndSection

Output of glxinfo | grep -i opengl:
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6
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: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

Can anyone help me to change the opengl implementation to nvidia? If other information is needed, I will add also.
Many many thanks in advance!

Long
nvidia-bug-report.log.gz (673.1 KB)

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

I have added and thanks for the notification!

Seems the driver was only loaded 10 minutes after boot. Please reboot, then create a new nvidia-bug-report.log.

I have reboot and here is the new report. Thanks!
nvidia-bug-report.log.gz (585.7 KB)

Looks fine, the Xserver is now running on the nvidia gpu. It doesn’t have a monitor connected, though. Are you trying to use OptiX from remote?

Yes, I am using this server computer through remote desktop. Is it possible that I can run OptiX like this?

rdpserver/vncserver only spawns a virtual Xserver, running on cpu. If you want to use the gpu hw accel, you’ll either have to connect to the real Xserver using x11vnc/vnc0server or set up VirtualGL. Though I don’t know whether VGL is enough to run OptiX.

Thanks for the response!
I want to connect to the real Xserver, so I have now connected the graphics directly to a monitor in the server room and I still wants to access it from remote desktop. So I have installed the x11vnc and run sudo x11vnc and it shows:

29/06/2022 13:01:17 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 41275
29/06/2022 13:01:17 Using X display :10.0
29/06/2022 13:01:17 rootwin: 0x510 reswin: 0x3400001 dpy: 0x2135990
29/06/2022 13:01:17
29/06/2022 13:01:17 ------------------ USEFUL INFORMATION ------------------
29/06/2022 13:01:17 X DAMAGE available on display, using it for polling hints.
29/06/2022 13:01:17 To disable this behavior use: ‘-noxdamage’
29/06/2022 13:01:17
29/06/2022 13:01:17 Most compositing window managers like ‘compiz’ or ‘beryl’
29/06/2022 13:01:17 cause X DAMAGE to fail, and so you may not see any screen
29/06/2022 13:01:17 updates via VNC. Either disable ‘compiz’ (recommended) or
29/06/2022 13:01:17 supply the x11vnc ‘-noxdamage’ command line option.
29/06/2022 13:01:17
29/06/2022 13:01:17 Wireframing: -wireframe mode is in effect for window moves.
29/06/2022 13:01:17 If this yields undesired behavior (poor response, painting
29/06/2022 13:01:17 errors, etc) it may be disabled:
29/06/2022 13:01:17 - use ‘-nowf’ to disable wireframing completely.
29/06/2022 13:01:17 - use ‘-nowcr’ to disable the Copy Rectangle after the
29/06/2022 13:01:17 moved window is released in the new position.
29/06/2022 13:01:17 Also see the -help entry for tuning parameters.
29/06/2022 13:01:17 You can press 3 Alt_L’s (Left “Alt” key) in a row to
29/06/2022 13:01:17 repaint the screen, also see the -fixscreen option for
29/06/2022 13:01:17 periodic repaints.
29/06/2022 13:01:17
29/06/2022 13:01:17 XFIXES available on display, resetting cursor mode
29/06/2022 13:01:17 to: ‘-cursor most’.
29/06/2022 13:01:17 to disable this behavior use: ‘-cursor arrow’
29/06/2022 13:01:17 or ‘-noxfixes’.
29/06/2022 13:01:17 using XFIXES for cursor drawing.
29/06/2022 13:01:17 GrabServer control via XTEST.
29/06/2022 13:01:17
29/06/2022 13:01:17 Scroll Detection: -scrollcopyrect mode is in effect to
29/06/2022 13:01:17 use RECORD extension to try to detect scrolling windows
29/06/2022 13:01:17 (induced by either user keystroke or mouse input).
29/06/2022 13:01:17 If this yields undesired behavior (poor response, painting
29/06/2022 13:01:17 errors, etc) it may be disabled via: ‘-noscr’
29/06/2022 13:01:17 Also see the -help entry for tuning parameters.
29/06/2022 13:01:17 You can press 3 Alt_L’s (Left “Alt” key) in a row to
29/06/2022 13:01:17 repaint the screen, also see the -fixscreen option for
29/06/2022 13:01:17 periodic repaints.
29/06/2022 13:01:17
29/06/2022 13:01:17 XKEYBOARD: number of keysyms per keycode 15 is greater
29/06/2022 13:01:17 than 4 and 443 keysyms are mapped above 4.
29/06/2022 13:01:17 Automatically switching to -xkb mode.
29/06/2022 13:01:17 If this makes the key mapping worse you can
29/06/2022 13:01:17 disable it with the “-noxkb” option.
29/06/2022 13:01:17 Also, remember “-remap DEAD” for accenting characters.
29/06/2022 13:01:17
29/06/2022 13:01:17 X FBPM extension not supported.
Xlib: extension “DPMS” missing on display “:10.0”.
29/06/2022 13:01:17 X display is not capable of DPMS.
29/06/2022 13:01:17 --------------------------------------------------------
29/06/2022 13:01:17
29/06/2022 13:01:17 Default visual ID: 0x21
29/06/2022 13:01:17 Read initial data from X display into framebuffer.
29/06/2022 13:01:17 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/10240
29/06/2022 13:01:17
29/06/2022 13:01:17 X display :10.0 is 32bpp depth=24 true color
29/06/2022 13:01:17
29/06/2022 13:01:17 Autoprobing TCP port
29/06/2022 13:01:17 Autoprobing selected TCP port 5900
29/06/2022 13:01:17 Autoprobing TCP6 port
29/06/2022 13:01:17 Autoprobing selected TCP6 port 5900
29/06/2022 13:01:17 listen6: bind: Address already in use
29/06/2022 13:01:17 Not listening on IPv6 interface.
29/06/2022 13:01:17
29/06/2022 13:01:17 Xinerama is present and active (e.g. multi-head).
29/06/2022 13:01:17 Xinerama: number of sub-screens: 1
29/06/2022 13:01:17 Xinerama: no blackouts needed (only one sub-screen)
29/06/2022 13:01:17
29/06/2022 13:01:17 fb read rate: 3046 MB/sec
29/06/2022 13:01:17 fast read: reset -wait ms to: 10
29/06/2022 13:01:17 fast read: reset -defer ms to: 10
29/06/2022 13:01:17 The X server says there are 10 mouse buttons.
29/06/2022 13:01:17 screen setup finished.
29/06/2022 13:01:17
29/06/2022 13:01:17 WARNING: You are running x11vnc WITHOUT a password. See
29/06/2022 13:01:17 WARNING: the warning message printed above for more info.
29/06/2022 13:01:17

The VNC desktop is: ihe-keros:0
PORT=5900


Have you tried the x11vnc ‘-ncache’ VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval. It should work with any VNC viewer. Try it by running:

x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth ‘copyrect’ window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

Sorry that I am quiet new to linux and I am not sure if I am doing it correctly. But now the OptiX still doesn’t work. Can you help me with this?

Thanks in advance!
Long

You connected to the ssh forwarded connection from your client.
Of course, you need to connect to the server’s Xserver :0
x11vnc -display :0

Then I have tried to run sudo x11vnc -display :0, the output is :

29/06/2022 15:02:02 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 54036
No protocol specified
29/06/2022 15:02:02 XOpenDisplay(“:0”) failed.
29/06/2022 15:02:02 Trying again with XAUTHLOCALHOSTNAME=localhost …
No protocol specified

29/06/2022 15:02:02 ***************************************
29/06/2022 15:02:02 *** XOpenDisplay failed (:0)

*** x11vnc was unable to open the X DISPLAY: “:0”, it cannot continue.
*** There may be “Xlib:” error messages above with details about the failure.

You’re likely connecting to the gdm login screen, this requires running as user gdm and setting the correct -auth (ps a |grep X).
Doesn’t matter though since after login, gdm spawns a new Xserver for the user session so you would lose the connection. Please switch to e.g. lightdm.

I have now installed and changed to lightdm,output of cat /etc/X11/default-display-manager:
/usr/sbin/lightdm
and I tried sudo x11vnc -display :0 again, still gives the same results.

After searching a little bit, maybe I should turn on the x11vnc using the monitor in the server room (which is directly connected to the graphics, but not turn on x11vnc using the remote desktop?), and then I can connect with the Xserver from my windows computer using vnc viewer?
Does that make sense?

You still have to set -auth.

Thanks! It works now and really appreciate your patience and time! Have a nice weekend!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.