Score:0

Ubuntu 20.04 VGA is not accelerated with nvidia gpu

us flag

I am running ubuntu 20.04 on lenovo yoga slim7 laptop which is loaded with nvidia 350M graphics card. I add ppa and apt installed nvidia-470 driver which is the latest one however GPU does not seem to be utilized for desktop GUI rendering as I feel delays in any screen input even for terminal.

Here is what the settings > About page look like.

enter image description here

I checked lspci to find VGA controller but could not find nvidia here.

$ lspci | grep VGA  
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G1 (Ice Lake) (rev 07)

and only find

$ 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)

Additional info

$ lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G1 (Ice Lake) (rev 07)
    Subsystem: Lenovo Device 3a34
    Kernel driver in use: i915
    Kernel modules: i915
--
30:00.0 3D controller: NVIDIA Corporation GP107M [GeForce MX350] (rev a1)
    Subsystem: Lenovo GP107M [GeForce MX350]
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

Is there a way to enable GPU for VGA controller?

Pilot6 avatar
cn flag
Please add output of `lspci -k | grep -EA3 'VGA|3D|Display'` command to your question. Format text uisng `{}` icon.
Kyuhyong You avatar
us flag
Sorry I just revised the format and added additional info you requested.
Pilot6 avatar
cn flag
So, the driver is installed I see no problems. You have dual graphics. You can switch to Nvidia in Nvidia X Server app.
Kyuhyong You avatar
us flag
I know the driver is installed but I feel delays in every keyboard input in the screen. Can you explain how to use nvidia x server app?
Pilot6 avatar
cn flag
Keyboard delays are not related. Run the app and see what is there. You can switch adapters there.
Kyuhyong You avatar
us flag
My other laptop which works great without any problem shows lspci | grep 'VGA' as below. 00:02.0 VGA compatible controller: Intel Corporation Device 3e9b 01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f11 (rev a1)
Pilot6 avatar
cn flag
So... why do you think keyboard delays are related to Nvidia?
Kyuhyong You avatar
us flag
well keyboard delay is just a symptom of GUI delays. I see slow in refreshing GUI whenever a new tab is clicked or partial updates and tearing. It seems like there is no graphics acceleration. And I see nvidia is only used for 3D and not for VGA. Maybe re-installing xserver-xorg-video-intel solve this issue?
Pilot6 avatar
cn flag
reinstalling anything will not solve anuthing
Kyuhyong You avatar
us flag
Well actually it did the trick! Reinstalling xserver driver for intel finally able to accelerate GUI and make it a lot faster but not smoother. Now I see little graphical noise all over the desktop.
Score:1
us flag

There has been a discussion regarding this issue here https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1937072

Problem is caused by PSR in ubuntu. To disable PSR, open /etc/default/grub with editor and add below line

GRUB_CMDLINE_LINUX_DEFAULT="i915.enable_psr=0"

If there is GRUB_CMDLINE_LINUX_DEFAULT, add # in front of the line.

Save and exit.

Enter "$ sudo update-grub" and "reboot"

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”.

Score:0
us flag

It seems like the issue here was about some nvidia drivers do not provide any acceleration for VGA and only handle 3D graphics. Without telling intel driver to accelerate the VGA, all GUI environment is not accelerated by anything. So I have to manually tell intel driver do the thing.

To solve this issue, I created xorg.conf file under /etc/X11/ and add 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

This setting enables VGA acceleration using intel driver and makes the graphics a lot faster.

Note that "Option "DRI" "1" " is added

However, this does not solve all the issue as I see some weird dots all over the desktop and screen tearing exactly like this Fuzzy graphics after upgrading to Ubuntu 20.04

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.