Graphics on Linux
Which graphics card do I have?
lspci | grep -i --color 'vga\|3d\|2d'
Output:
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119M [Quadro NVS 4200M] (rev a1)
Note that we find two entries because I have a hybrid graphics setup. I have both:
- integrated graphics on an Intel chip
- an (old) NVIDIA GPU
In a hybrid setting, the idea is that you use the Intel chip for regular use with lower power requirements and only use the NVIDIA GPU when heavy lifting is needed, e.g. in gaming.
The GPU has the id 01:00.0.
You can get detailed info on this using:
sudo lspci -v -s 01:00.0
Output:
01:00.0 VGA compatible controller: NVIDIA Corporation GF119M [Quadro NVS 4200M] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Lenovo Device 21d0
!!! Unknown header type 7f
Memory at f0000000 (32-bit, non-prefetchable) [size=16M]
Memory at c0000000 (64-bit, prefetchable) [size=256M]
Memory at d0000000 (64-bit, prefetchable) [size=32M]
I/O ports at 5000 [size=128]
Expansion ROM at f1080000 [disabled] [size=512K]
Kernel modules: nouveau, nvidia_drm, nvidia
This model is supported by nvidia drivers 304.135 to 390.132 (just look this up on the internet).
This is an older driver series which I need to get from the AUR.
yay -S nvidia-390xx
This also installs the corresponding utils.
For Steam, we only need:
yay -S lib32-nvidia-390xx-utils
Make sure that all version numbers of all nvidia drivers and utils are the same! Otherwise you'll get all kinds of weird errors down the line.
~ λ yay -Q | grep nvidia
lib32-nvidia-390xx-utils 390.154-1
lib32-opencl-nvidia-390xx 390.132-1
nvidia-390xx 390.154-1
nvidia-390xx-dkms 390.154-1
nvidia-390xx-utils 390.154-1
I do have that opencl implementation with a different version number... don't know if that's going to cause issues but it's required by other packages.
After this the following should not give errors:
sudo modprobe nvidia
sudo modprobe nvidia_uvm
sudo modprobe nvidia_modeset
sudo modprobe nvidia_drm
Methods for using hybrid graphics
See: https://wiki.archlinux.org/title/NVIDIA_Optimus
Trying nvidia-xrun
yay -S nvidia-xrun-git
Actually doesnt work with the 390xx drivers, conflict with nvidia-utils.
Using PRIME render offload
https://wiki.archlinux.org/title/PRIME#PRIME_render_offload
The arch wiki says this method is supported from driver version 435.17 onwards, but I have 390xx.
I indeed get errors when using prime-run glxgears.
Optimus manager
yay -S optimus-manager
systemctl status optimus-manager
Usage (Switching closes your X session!):
optimus-manager --switch nvidia
optimus-manager --switch integrated
optimus-manager --switch hybrid
This seems to work! HURRAY.
TODO manually set power management options: https://github.com/Askannz/optimus-manager/wiki/A-guide--to-power-management-options
By default this is not configured and leaved the GPU running constantly, usinga lot of power.
Vulkan
Trying to install Vulkan
vulkan-headers
vulkan-icd-loader
lib32-vulkan-icd-loader
vulkan-tools
I had everything installed except vulkan-tools.
Run vulkaninfo and vkcube to verify.
Both fail for me.
~ λ vulkaninfo
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Failed to detect any valid GPUs in the current config
ERROR at /build/vulkan-tools/src/Vulkan-Tools-1.3.226/vulkaninfo/vulkaninfo.h:237:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED
And:
~ λ vkcube
vkEnumeratePhysicalDevices reported zero accessible devices.
Do you have a compatible Vulkan installable client driver (ICD) installed?
Please look at the Getting Started guide for additional information.