Hello,
I hope this will also help other folks in a similar situation. I have custom-built setup (no laptop !) with both the Intel iGPU and Nvidia GTX 1080 as dGPU on Ubuntu 20.04
Context
The primary goal for the Nvidia card was to run CUDA programs such as Hashcat but still using the Intel iGPU for display and everything else (and keeping power draw to bare minimum)
Hashcat succesfully works using Nvidia, however the Prime On-Demand / offloading as such does not seem to work.
I’ve tinkered around for hours and would appreciate if you can shed lights on what’s wrong.
Note, this server is mainly “headless” but still set up as a desktop, mainly accessing from remote with e.g. NoMachine (I put a dummy DVI adapter to makes things easy)
Current install
- nvidia propriatory drivers installed (nvidia-headless) (version 460)
- Xorg files created / modified in such a way that the Screen is associated to the iGPU with “modesetting” as driver
- Nouveau blacklisted
- PRIME set to On-demand
- See commands output below and attached nvidia-debug file
- I also disabled GPU-manager (by adding nogpumanager to Grub) so that /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf don’t get overwritten
$ sudo lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1080] (rev a1)
$ nvidia-smi
Tue Jan 26 21:26:43 2021
±----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------±---------------------±---------------------+
| 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 GeForce GTX 1080 Off | 00000000:01:00.0 Off | N/A |
| 23% 34C P0 34W / 180W | 0MiB / 8119MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------++-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+
$ prime-select query
on-demand
Issue
- I only have 1 provider
- When I “force” Render offloading, it does not work, see below with glxinfo
- In idle mode, power draw is always around 35W (as you can see in nvidia-smi). While I understand that (for now ?) GTX cannot benefit from proper power management, why is this so high ? Any way to reduce that / turn off (without having to force Prime-Intel) ?
xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x45 cap: 0x0 crtcs: 3 outputs: 3 associated providers: 0 name:modesetting
$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep -iE ‘OpenGL renderer|vendor’
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
Vendor: Mesa/X.org (0xffffffff)
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 11.0.0, 256 bits)
$ glxinfo | grep -iE ‘OpenGL renderer|vendor’
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
Vendor: Mesa/X.org (0xffffffff)
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 11.0.0, 256 bits)
Cause / Remediation
- Could it be because Prime Render Offloading is (still) not available in Xorg ? I’m on Ubuntu 20.04.1, see Xorg version below
- Misconfiguration ?
Thank you very much !
Xorg config
nvidia-bug-report.log.gz (304.3 KB) > $ cat /etc/X11/xorg.conf.d/10-intel.conf
Section "ServerLayout" Identifier "layout" Screen 0 "intelscreen" #Screen 1 "nvidiascreen" Option "AllowNVIDIAGPUScreens" #Inactive "nvidiadevice" EndSection Section "Device" Identifier "inteldevice" Driver "modesetting" BusID "PCI:0:2:0" Option "AccelMethod" "sna" EndSection Section "Device Identifier "nvidiadevice" Driver "nvidia" BusID "PCI:1:0:0" Option "ConstrainCursor" "off" Option "Coolbits" "28" Option "AllowEmptyInitialConfiguration" EndSection Section "Screen" Identifier "intelscreen" Device "inteldevice" EndSection Section "Screen" Identifier "nvidiascreen" Device "nvidiadevice" Option "IgnoreDisplayDevices" "CRT" EndSection
$ cat /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
# DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-managerSection "OutputClass" Identifier "Nvidia Prime" MatchDriver "nvidia-drm" Driver "nvidia" Option "AllowEmptyInitialConfiguration" Option "IgnoreDisplayDevices" "CRT" #Option "PrimaryGPU" "Yes" <<< commented out by me # added nogpumanager to grub otherwise it gets overwritten ModulePath "/lib/x86_64-linux-gnu/nvidia/xorg" EndSection # added this section # not sure how it interacts with /etc/X11/xorg.conf.d/ Section "OutputClass" Identifier "intel" MatchDriver "i915" Driver "modesetting" #Driver "intel" Option "PrimaryGPU" "yes" EndSection