Kyubot
October 25, 2021, 1:19pm
1
I fresh installed ubuntu 20.04 on my laptop with i5 cpu and MX350 graphics card.
I apt installed nvidia-driver-470
And I found nvidia driver is only working as 3D and VGA is still managed by intel graphics as lspci shows below
$ lspci | egrep -i "vga|display|3d"
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G1 (Ice Lake) (rev 07)
30:00.0 3D controller: NVIDIA Corporation GP107M [GeForce MX350] (rev a1)
This resulted GUI acceleration is not applied thus making xorg desktop become very slow and not responsive.
So I created xorg.conf under /etc/X11 as below
Section "ServerLayout"
Identifier "layout"
Screen 0 "intel"
Screen 1 "nvidia"
EndSection
Section "Device"
Identifier "intel"
Driver "intel"
BusID "PCI:0@0:2:0"
Option "AccelMethod" "sna"
Option "DRI" "1"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1@0:0:0"
Option "ConstrainCursor" "off"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration" "on"
Option "IgnoreDisplayDevices" "CRT"
EndSection
Now everything works fine but I am getting error when running anything with 3D graphics.
$ ./simpleGL
simpleGL (VBO) starting...
GPU Device 0: "Pascal" with compute capability 6.1
CUDA error at simpleGL.cu:421 code=999(cudaErrorUnknown) "cudaGraphicsGLRegisterBuffer(vbo_res, *vbo, vbo_res_flags)"
CUDA error at simpleGL.cu:433 code=400(cudaErrorInvalidResourceHandle) "cudaGraphicsUnregisterResource(vbo_res)"
It seems like GPU is not utilized for any graphics acceleration. How can I solve this issue? Any help would be much appreciated.
I also attached nvidia-smi result below
$ nvidia-smi
Mon Oct 25 22:22:10 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| 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 GeForce ... On | 00000000:30:00.0 Off | N/A |
| N/A 41C P8 N/A / N/A | 4MiB / 2002MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 825 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
Please delete your xorg.conf, the settings on ubuntu are manage by the gpu-manager.
Per default, with ubuntu on an Optimus enabled notebook, the nvidia gpu is used in on-demand mode, meaning you have to explicitly demand it
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./simpleGL
or switch to nvidia exclusive mode using
sudo prime-select nvidia
and reboot.
Kyubot
October 26, 2021, 12:25am
3
Hi, thanks for your comment.
As I described, when there is no xorg.conf, VGA acceleration is not handled by any device (internal or external gpu)
I also did sudo prime-select nvidia but did not solve the issue.
I did see simpleGL is running on GPU with this command.
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./simpleGL
Can you tell me what is needed to fix xorg.conf to use GPU acceleration as default.
generix
October 26, 2021, 10:46am
4
prime-select nvidia and rebooting should switch to nvidia always, if it doesnât, please create a new nvidia-bug-report.log in that state.
Kyubot
October 27, 2021, 2:13am
5
Here I attached the issue with using nvidia gpu for xorg rendering.
Please check this video.
Compare to GUI rendering with intel cpu, there are significant delay, rendering issues when gpu is used for graphics.
I switched to gpu graphics by entering below command
$ sudo nvidia-xconfig --prime
I only assume that when gpu is used, it doesnât really do anything about VGA and only kicks in when 3D graphics required.
I even tried to switch between NVIDIA Performance Mode and NVIDIA On-Demand mode in nvidia-settings but no difference.
Please create a new nvidia-bug-report.log while switched to performance mode.
Kyubot
October 27, 2021, 12:30pm
7
I attached the bug report. Thanks.
nvidia-bug-report.log.gz (282.7 KB)
generix
October 27, 2021, 12:56pm
8
Please delete /etc/X11/xorg.conf, itâs overriding Ubuntuâs gpu-manager.
Furthermore, please set kernel parameter
nvidia-drm.modeset=1
Kyubot
October 27, 2021, 1:17pm
9
I deleted it.
Also checked nvidia-drim modeset=1
$ cat /etc/modprobe.d/nvidia-drm-nomodeset.conf
options nvidia-drm modeset=1
But it doesnât really help improving xorg rendering.
generix
October 27, 2021, 1:20pm
10
Please create a new nvidia-bug-report.log in the current state.
Please also check if drm modesetting is active,
sudo cat /sys/module/nvidia_drm/parameters/modeset
should return âYâ if done right.
Kyubot
October 27, 2021, 1:24pm
11
Here is another bug report.
nvidia-bug-report.log.gz (305.3 KB)
Also checked drm modeset as below. âYâ is returned.
$ sudo cat /sys/module/nvidia_drm/parameters/modeset
Y
generix
October 27, 2021, 1:48pm
12
Ok, everything seems to be set up and running cleanly, so itâs a bit mysterious.
Besides the input lag, are there any other rendering issues (delays, artifacts)?
Kyubot
October 27, 2021, 1:55pm
13
Well, rendering issue still there as you can see.
Thank you for helping me out anyway. Donât know what else can be done.
Hope another driver update will fix this issue.
generix
October 27, 2021, 2:05pm
14
Ok, the previous video was a bit too blocky to notice the other effects.
All of this rather looks like compositor faults, are you running plain Ubuntu with gnome or any other DE?
Kyubot
October 27, 2021, 2:30pm
15
I donât get it what other DE, but I installed using official ubuntu 20.04 iso image and had not changed anything about desktop environment.
Kyubot
October 27, 2021, 3:01pm
16
I found a thread exactly about this issue here.
Though I have no idea about what PSR is, disabling it by adding
GRUB_CMDLINE_LINUX_DEFAULT="i915.enable_psr=0"
to /etc/default/grub
then â$ sudo update-grubâ and ârebootâ
seem to fix the screen tearing, delayed rendering issue.
To check if PSR is enabled by entering
$ sudo cat /sys/module/i915/parameters/enable_psr
should return â0â zero.
Formerly, it gave me â-1â.
generix
October 27, 2021, 3:09pm
17
Great!
PSR means panel self refresh, so that when the gpu doesnât have anything new to render, it doesnât need to push the same picture over and over to the panel. Saves energy, but is broken on some panels (like mine). So far, this only resulted in flickering which was very easy to assign to psr.
1 Like
Kyubot
October 27, 2021, 3:17pm
18
Thanks for helping me. Your guide has been great for me to understand.
system
Closed
November 10, 2021, 3:18pm
19
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.