GTX 1650-super expresscard egpu reports 'not DRI capable' on ubuntu 20.04, so steam games won't start

Hi there including bug report log.
nvidia-bug-report.log.gz (235.6 KB)

I’m running this card in an egpu expresscard adapter.
At the moment drivers are installed from ubuntu, in a meta-package as per usual instructions - although I have also tried using the run script as well.
This part of configuration seems OK, I have the computer in reported ‘nvidia’ mode, with display output to external HDMI monitor, desktop displays fine.
The problem is that steam games will not load in this mode, and if I try to run this for example:

$ LIBGL_DEBUG=verbose glxgears

I get this output:
libGL: screen 0 does not appear to be DRI3 capable
libGL: screen 0 does not appear to be DRI2 capable
libGL: MESA-LOADER: failed to open /usr/local/lib/x86_64-linux-gnu/dri/swrast_dri.so: libsensors.so.4: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/local/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 42
Current serial number in output stream: 41

So I assume this is also why steam won’t work properly.
Also, just loading the Steam app results in a black area inside the window where the content should be, I can only see games etc if I switch to fullscreen mode, and then they won’t launch anyway - as mentioned.

It’s been suggested that /etc/X11/xorg.conf and /usr/share/X11/xorg.conf.d/10-nvidia.conf may need changing as well. There’s a script I’ve tried installing to automate this process to no avail. I can post what they are currently if needs be.

More info:

$ sudo inxi -SMGxx
System:
Host: ThinkPad-T430 Kernel: 5.4.0-52-generic x86_64 bits: 64 compiler: gcc
v: 9.3.0 Desktop: Xfce 4.14.2 tk: Gtk 3.24.13 wm: xfwm4 dm: LightDM
Distro: Ubuntu 20.04.1 LTS (Focal Fossa)
Machine:
Type: Laptop System: LENOVO product: 2349T6X v: ThinkPad T430
serial: PBM3K2M Chassis: type: 10 serial: PBM3K2M
Mobo: LENOVO model: 2349T6X serial: 1ZSLY3934SE UEFI: LENOVO
v: G1ETA4WW (2.64 ) date: 03/06/2014
Graphics:
Device-1: Intel 3rd Gen Core processor Graphics vendor: Lenovo
driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:0166
Device-2: NVIDIA TU116 [GeForce GTX 1650 SUPER] vendor: PNY driver: nvidia
v: 450.80.02 bus ID: 04:00.0 chip ID: 10de:2187
Display: server: X.Org 1.20.8 driver: modesetting,nvidia
resolution: 1920x1080~60Hz, 1600x900~60Hz
OpenGL: renderer: N/A v: N/A direct render: N/A

Ok, i found the solution: Confused libraries.
Chapter 5 of the linux driver manual pointed the way.
$ ldd glxgears

Showed that copies of various objects from /usr/local were getting loaded instead of those from the package. I’d been building a copy of mesa from source in trying to get something else to work and forgotten them.
Uninstalling these from my src directory and rerunning ldconfig did the trick.