Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
zlochko

Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by zlochko »

Hello,
I am trying to put in good use the nvidia drivers on my laptop and I'm having hard time doing that.
optirun glxgears throws the following output:

Code: Select all

libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
The directory /usr/lib/x86_64-linux-gnu/dri/tls does not exists, while the file /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so is there.
Also .drirc is non existent directory in both /root/ & my home folder.

Any suggestions?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by deepakdeshp »

This forum is for Mint users. For Xiomi you can post here
https://www.google.co.in/url?sa=t&sourc ... pfwgsnS4sA
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
zlochko

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by zlochko »

deepakdeshp wrote:This forum is for Mint users. For Xiomi you can post here
https://www.google.co.in/url?sa=t&sourc ... pfwgsnS4sA
OMG... :lol: I guess it's my fault I haven't specified I have Mint 18 Cinnamon edition.
Now can you please try to help me? :)
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by deepakdeshp »

Please update your system .
This may help viewtopic.php?f=49&t=234454
Also see what options are available in driver manager. You can change the drivers ,reboot and test
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
Object11

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by Object11 »

Hello! I have similar problem in Mint 18.1 MATE
I have mi air 13 notebook. It has two graphic cards: intel card and discret nvidia 940mx.
Intel works without any problems, except of tearing problem. But it was solved
viewtopic.php?t=224942#p1197049

But there are a lot of problems with nvidia. I've done the following actions:
1) Install new video driver from (ppa:graphics-driver). i was trying to install 304, 340, 370, 375, but after reboot, i have seen black screen.
ctrl+alt+f1 and login, I can't do startx (without cause). Only after apt-get remove nvidia-** and reboot, system boot normaly. Without proprietary nvidia driver.

2) Install from system driver manager. It try to install nvidia-367 version, and this solution can correct boot, sometimes) But steam can't start.
Steam says:
opengl glx extension not supported by display

glxinfo:
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig

glxgears:
Error: couldn't get an RGB, Double-buffered visual

3) Install from .run file from nvidia site works like in point 1.

But in intel card mode, both this commands work perfectly. And steam works fine too.

In all cases i have very strange nvidia-settings menu, only 3 parts: PRIME Profiles, Application profiles, nvidia-settings Configuration. Usually, it has many parts about display and etc.

$ lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Sky Lake Integrated Graphics (rev 07)
01:00.0 3D controller: NVIDIA Corporation Device 134b (rev a2)
christophe

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by christophe »

Hey,
Same machine, same issue.

Has anyone been successful in installing Nvidia ?

Thanks,
C.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by roblm »

christophe,

Would you use these commands in the Terminal and post the output:

Code: Select all

1. inxi -SMCGx
2. cat /var/log/gpu-manager.log	        
3. dpkg -l |grep -i nvidia
4. lspci -nnk |egrep -A3 -i "3D|VGA"
5. ls /etc/modprobe.d
6. ls /etc/X11
7. sudo prime-select nvidia
christophe

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by christophe »

Hey rob,

Sorry for this late answer, was on leave for a couple of days - and thanks.
I removed the Nvidia drivers as could not start the machine again after installing nvidia-367 via the driver manager.

ouptut of the commands are as below,
Cheers,

1. inxi -SMCGx

Code: Select all

System: Host: christophe-TM1613 Kernel: 4.4.0-53-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: Cinnamon 3.2.7 (Gtk 3.18.9-1ubuntu3.1)
Distro: Linux Mint 18.1 Serena
Machine: System: Timi (portable) product: TM1613 v: A05
Mobo: Timi model: TM1613 v: A05
Bios: Insyde v: A05 date: 08/11/2016
CPU: Dual core Intel Core i5-6200U (-HT-MCP-) cache: 3072 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9599
clock speeds: max: 2800 MHz 1: 799 MHz 2: 796 MHz 3: 798 MHz
4: 798 MHz
Graphics: Card-1: Intel Sky Lake Integrated Graphics bus-ID: 00:02.0
Card-2: NVIDIA Device 134b bus-ID: 01:00.0
Display Server: X.Org 1.18.4 driver: intel
Resolution: 1920x1080@59.93hz
GLX Renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2)
GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
2. cat /var/log/gpu-manager.log

Code: Select all

log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can’t access /run/u-d-c-fglrx-was-loaded file
Looking for fglrx modules in /lib/modules/4.4.0-53-generic/updates/dkms
Looking for nvidia modules in /lib/modules/4.4.0-53-generic/updates/dkms
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is fglrx loaded? no
Was fglrx unloaded? no
Is fglrx blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is fglrx kernel module available? no
Is nvidia kernel module available? no
Vendor/Device Id: 8086:1916
BusID “PCI:0@0:2:0”
Is boot vga? yes
Vendor/Device Id: 10de:134b
BusID “PCI:1@0:0:0”
Is boot vga? no
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “i915_bpo”
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “i915_bpo”
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “i915_bpo”
Skipping “/dev/dri/card1”, driven by “nvidia-drm”
Found “/dev/dri/card0”, driven by “i915_bpo”
output 0:
card0-eDP-1
Number of connected outputs for /dev/dri/card0: 1
Does it require offloading? yes
last cards number = 1
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
The number of cards has changed!
Has the system changed? Yes
main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu
Current alternative: /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
Current core alternative: (null)
Current egl alternative: /usr/lib/x86_64-linux-gnu/mesa-egl/ld.so.conf
Is nvidia enabled? no
Is nvidia egl enabled? no
Is fglrx enabled? no
Is mesa enabled? yes
Is mesa egl enabled? yes
Is pxpress enabled? no
Is prime enabled? no
Is prime egl enabled? no
Is nvidia available? yes
Is nvidia egl available? no
Is fglrx available? no
Is fglrx-core available? no
Is mesa available? yes
Is mesa egl available? yes
Is pxpress available? no
Is prime available? yes
Is prime egl available? no
System configuration has changed
Intel IGP detected
Intel hybrid system
Nvidia driver version 367.57 detected
/sys/class/dmi/id/product_version=”A05”
/sys/class/dmi/id/product_name=”TM1613”
1st try: bbswitch without quirks
Loading bbswitch with “load_state=-1 unload_state=1” parameters
Selecting nvidia
/usr/bin/update-alternatives —set x86_64-linux-gnu_gl_conf /usr/lib/nvidia-367/ld.so.conf
update-alternatives status 0
Calling ldconfig
ldconfig status 0
/usr/bin/update-alternatives —set i386-linux-gnu_gl_conf /usr/lib/nvidia-367/alt_ld.so.conf
update-alternatives status 0
Calling ldconfig
ldconfig status 0
/usr/bin/update-alternatives —set x86_64-linux-gnu_egl_conf /usr/lib/nvidia-367/ld.so.conf
update-alternatives status 0
Calling ldconfig
ldconfig status 0
/usr/bin/update-alternatives —set i386-linux-gnu_egl_conf /usr/lib/nvidia-367/alt_ld.so.conf
update-alternatives status 0
Calling ldconfig
ldconfig status 0
can’t access /etc/X11/xorg.conf
Check failed
Removing xorg.conf. Path: /etc/X11/xorg.conf
Moved /etc/X11/xorg.conf to /etc/X11/xorg.conf.03082017
Regenerating xorg.conf. Path: /etc/X11/xorg.conf
intel_matches: 0, nvidia_matches: 1, intel_set: 0, nvidia_set: 0 x_options_matches: 0, accel_method_matches: 1
Check failed
Removing xorg.conf. Path: /etc/X11/xorg.conf
Regenerating xorg.conf. Path: /etc/X11/xorg.conf
No need to change the current bbswitch status

3. dpkg -l |grep -i nvidia

Code: Select all

ii	bbswitch-dkms	0.8-3ubuntu1	amd64	Interface for toggling the power on NVIDIA Optimus video cards
ii	bumblebee	3.2.1-10	amd64	NVIDIA Optimus support for Linux
rc	nvidia-367	367.57-0ubuntu0.16.04.1	amd64	NVIDIA binary driver - version 367.57
rc	nvidia-opencl-icd-367	367.57-0ubuntu0.16.04.1	amd64	NVIDIA OpenCL ICD
rc	nvidia-prime	0.8.2linuxmint1	amd64	Tools to enable NVIDIA’s Prime
rc	nvidia-prime-applet	1.0.6	all	An applet for NVIDIA Prime
rc	nvidia-settings	361.42-0ubuntu1	amd64	Tool for configuring the NVIDIA graphics driver

4. lspci -nnk |egrep -A3 -i “3D|VGA”

Code: Select all

00:02.0 VGA compatible controller [0300]: Intel Corporation Sky Lake Integrated Graphics [8086:1916] (rev 07)
Subsystem: Device [1d72:1602]
Kernel driver in use: i915_bpo
Kernel modules: i915_bpo
01:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:134b] (rev ff)
Kernel modules: nvidiafb, nouveau
02:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)
Subsystem: Intel Corporation Wireless 8260 [8086:9010]
5. ls /etc/modprobe.d

Code: Select all

alsa-base.conf blacklist-firewire.conf blacklist-oss.conf bumblebee.conf intel-microcode-blacklist.conf vmwgfx-fbdev.conf
blacklist-ath_pci.conf blacklist-framebuffer.conf blacklist-rare-network.conf dkms.conf iwlwifi.conf
blacklist.conf blacklist-modem.conf blacklist-watchdog.conf fbdev-blacklist.conf mlx4.conf
6. ls /etc/X11

Code: Select all

app-defaults default-display-manager fonts rgb.txt xinit xkb xorg.conf.03082017 Xreset Xreset.d Xresources Xsession Xsession.d Xsession.options xsm
7. sudo prime-select nvidia

Code: Select all

sudo: prime-select: command not found
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by roblm »

If you want to use the Nvidia driver, then you need to install it again. If there is a startup problem after rebooting, then press Ctrl+Alt+F1 to enter the virtual console tty1. Login and then type this command to switch to the Intel GPU:

Code: Select all

sudo prime-select intel
Then type: sudo reboot. At the desktop post the output of the commands I listed in my first post again, but not the first.

If you can't enter tty1, then press Ctrl+Alt+Delete to reboot and select Recovery Mode at the GRUB boot menu. If no menu shows, then hold down the Shift key while starting. In the menu, select “root - drop to root shell prompt”. When asked for the root password, just type your user password. Then change the file permissions to read and write by typing:

Code: Select all

mount -o remount,rw /

Then type this command to switch to the Intel GPU:

Code: Select all

prime-select intel
Then type this command and wait: reboot. At the desktop post the output of the commands I listed in my first post again, but not the first.
christophe

Re: Failed to load driver: swrast (nvidia 940mx on xiaomi mi air 13)

Post by christophe »

Thanks a lot for this detailed guide, truly appreciated. I'll try it out tonight - when I'll have some more time - and let you know the result,
Best,
C,
Locked

Return to “Graphics Cards & Monitors”