OK. So i have set everything up as per the arch wiki and the nvidia docs http://us.download.nvidia.com/XFree86/Linux-x86_64/430.14/README/randr14.html and if i execute:
glxinfo | grep vendor
I get
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: Intel Open Source Technology Center
This is the expected response. However if i try prime offloading using
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor
I get
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 39
Current serial number in output stream: 40
Yet if I lsmod i can see that the nvidia drivers are indeed loaded.
nvidia_drm 49152 1
drm_kms_helper 212992 2 nvidia_drm,i915
drm 516096 15 drm_kms_helper,nvidia_drm,i915
nvidia_uvm 1085440 0
nvidia_modeset 1114112 1 nvidia_drm
nvidia 19980288 2 nvidia_uvm,nvidia_modeset
ipmi_msghandler 69632 2 ipmi_devintf,nvidia
FWIW. I initially had my laptop setup to only use the built in nvidia card but it was draining my battery too quickly.
Also the output from nvidia-smi is
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.36 Driver Version: 440.36 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1050 Off | 00000000:01:00.0 Off | N/A |
| N/A 49C P0 N/A / N/A | 0MiB / 4042MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
nvidia-bug-report.log.gz (368 KB)