Disclaimer: We may earn a commission when you purchase products linked throughout our site.

Nvidia Optimus on Ubuntu: PRIME and GPU Troubleshooting

Nvidia Optimus on Ubuntu: PRIME and GPU Troubleshooting

Identify the GPUs and driver on an Ubuntu laptop, verify PRIME render offload, and diagnose display, docking and login failures safely.

On a hybrid Nvidia laptop, first separate three questions. Does Ubuntu see both GPUs? Is the Nvidia driver loaded? Which GPU draws the application you care about? A running Nvidia driver answers only the middle question. The integrated GPU can still draw the desktop while a selected application renders on Nvidia.

Identify GPUs, drivers and the desktop session

Run these checks before changing a driver or graphics profile. Run the session check inside the affected graphical login.

lspci -nnk | grep -EA3 'VGA compatible controller|3D controller|Display controller'
printf '%s\n' "$XDG_SESSION_TYPE"
uname -r
ubuntu-drivers devices

Record the PCI devices and the Kernel driver in use for each. On a system configured for Nvidia’s driver, nvidia-smi can query that driver and show reported processes. A missing command says the utility is absent. An error talking to a driver calls for checking the current kernel and module. Neither result alone establishes hardware failure. The Arch Wiki’s Optimus article explains the history of these hybrid configurations.

Understand the available graphics modes

A hybrid or on-demand mode can let the integrated GPU drive the desktop and use Nvidia for selected applications. A discrete-only mode can use the Nvidia GPU more widely, often at greater power cost. A firmware MUX or chassis design may change which GPU is attached to a display connector. Check the model’s display routing before assuming that a port will remain usable with the discrete GPU disabled.

If prime-select is installed, prime-select query reports its configured profile. This describes configuration. It cannot tell you which GPU one process uses or which connector it drives. Record the result before changing it.

Verify which GPU runs the application

For a GLX application on Xorg or through Xwayland, compare the default renderer with a one-command Nvidia offload request. The Ubuntu mesa-utils package supplies glxinfo.

glxinfo -B
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo -B

Look at the renderer lines in both outputs. They tell you about those GLX queries, not a Wayland-native or Vulkan application. For the program that matters, try the desktop’s Launch using Discrete Graphics Card action if available, then check the app’s renderer or device diagnostics. Fully exit an existing instance first. Reusing a running process can silently ignore the offload environment of a second launch. Nvidia’s PRIME Render Offload documentation explains the distinctions between GLX, EGL and Vulkan.

Check external displays and docking

Start with the internal panel and one external monitor. Record whether the output is missing in display settings, appears with no signal, or loses signal only after sleep. Compare a direct port and the dock without changing the driver between attempts. A dead port in one profile with a working internal panel is evidence to investigate output routing and the dock. It does not make nvidia-smi or an application benchmark a display test.

Troubleshoot installation and startup failures

On Ubuntu, start with Software & Updates > Additional Drivers where available or inspect ubuntu-drivers devices. Use the Ubuntu-recommended driver for the release and device unless you have a specific documented reason to choose another. Prefer a supported repository workflow and record the current package version and origin with apt policy. A new kernel with a missing matching module and a Secure Boot enrolment problem can both leave driver packages installed with no working module.

From a text console, journalctl -k -b shows messages from the current kernel. If the driver recently changed, compare it with the previous boot using journalctl -k -b -1 when logs are available. Use mokutil --sb-state if installed to check Secure Boot state. Canonical documents the signed-driver process in its Nvidia driver installation guide. A working text console with a failed greeter calls for checking the session as well as the module. See desktop session recovery for a lower-impact recovery sequence.

Restore the previous working configuration

If a one-command offload comparison failed, close the app and launch it normally again. If a profile change caused the problem, restore the recorded profile using the same tool. Before logging out or restarting, save work. Driver changes are harder to unwind. Record transaction details from /var/log/apt/history.log and, if a kernel update coincided with the failure, boot the previous installed kernel through GRUB’s advanced options for diagnosis. Preview exact package changes before applying any rollback.

Verify login, the internal display, the external connector you use and a real application after recovery. Each check answers a different question.

Interpret older Bumblebee instructions

Bumblebee and its optirun workflow belong to an earlier generation of hybrid graphics setup. Treat an old guide as historical context. Check the installed driver and Ubuntu release before adding a legacy package or an old PPA, and use the render offload workflow documented for your present stack.