DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau

Hi, I am pretty new to nixos, I have created my first system, configuration can be seen here: nixos/hosts/default/configuration.nix at dde762cb453a9eae0d273ce09ecdcfb1485f64e2 · radek-stasta/nixos · GitHub

I have laptop with integrated gpu and Nvidia gpu and it seems that I have something somewhere badly configured. When I try to open Chrome for example, it takes around 2 minutes to open with many errors

DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau. libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed

When I disable hardware acceleration in Chrome, it opens instantly without any problems. It happens also for example with Steam with exactly the same message. Is there something I can do?

Nvk is collabora’s fancy new open source vulkan driver. Recent kernels probably support it, but it should definitely not be loading if you set yoir driver to "nvidia". Is this your full config?

Yes, it is. You can look at the whole repository. There is also home.nix configuration for home manager, but nothing relevant there I think, only setting dotfiles and some settings for apps. Nothing relevant to nvidia

Any help please? Does anyone have the same issue or is it just my bad configuration?

Is this the same log line or two lines?

If this is just one line of log, this is probably a red herring. libva is not critical to chrome’s operation.

This is log after opening Chrome. Took from 8:53 to 8:56 to start:

>  rstasta@nixos  ~  ✖ 08:53  google-chrome-stable
> DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
> libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
> [45438:45567:0328/085316.209912:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
> [45438:45567:0328/085316.210106:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
> [45438:45567:0328/085316.210269:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
> INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
> [0328/085346.166359:ERROR:process_memory_range.cc(75)] read out of range
> [45624:1:0328/085346.174729:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45592:1:0328/085346.174745:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [45602:1:0328/085346.174750:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [45573:1:0328/085346.174785:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45515:1:0328/085346.174785:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45438:45438:0328/085346.179516:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=512
> DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
> libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
> [0328/085416.326545:ERROR:process_memory_range.cc(75)] read out of range
> [45602:1:0328/085416.335899:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45592:1:0328/085416.335893:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [46015:1:0328/085416.336071:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [46015:11:0328/085416.336101:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46287:1:0328/085416.336041:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [46015:12:0328/085416.336151:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [45916:1:0328/085416.336152:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45573:1:0328/085416.336175:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45438:45438:0328/085416.343776:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=512
> DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
> libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
> [0328/085446.514799:ERROR:process_memory_range.cc(75)] read out of range
> [46015:12:0328/085446.523587:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46015:11:0328/085446.523654:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46826:1:0328/085446.523744:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45573:1:0328/085446.523765:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [46777:1:0328/085446.523763:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
> [45438:45438:0328/085446.529200:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=512
> DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
> libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
> [45557:7:0328/085446.656552:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [45592:13:0328/085446.656556:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [45916:13:0328/085446.656628:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46287:12:0328/085446.656632:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46015:11:0328/085446.657893:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46777:12:0328/085446.659003:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
> [46826:13:0328/085446.659851:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.

And journalctl is full of this:

bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b
bře 28 08:54:46 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x000000006bbffe6b

This is when I disable hardware acceleration in Chrome, then it starts instantly and not a single line in journalctl:

 rstasta@nixos  ~  ♥ 09:00  google-chrome-stable
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
[59923:60057:0328/090019.854002:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[59923:60057:0328/090019.854195:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[59923:60057:0328/090019.854370:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
[59970:59970:0328/090023.425488:ERROR:gles2_cmd_decoder_passthrough.cc(947)] ContextResult::kFatalFailure: fail_if_major_perf_caveat + swiftshader
[59970:59970:0328/090023.428037:ERROR:gles2_cmd_decoder_passthrough.cc(947)] ContextResult::kFatalFailure: fail_if_major_perf_caveat + swiftshader
[59970:59970:0328/090023.430123:ERROR:gles2_cmd_decoder_passthrough.cc(947)] ContextResult::kFatalFailure: fail_if_major_perf_caveat + swiftshader
1 Like

Hm, interesting; NVK shouldn’t attempt to load here. Are you able to run vkcube and glxgears?

vkcube (starts instantly, cube spinning, nothing in journalctl):

rstasta@nixos  ~  ♥ 09:24  vkcube 
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
Selected GPU 1: NVIDIA GeForce RTX 3070 Laptop GPU, type: DiscreteGpu

glxgears (same as vkcube):

rstasta@nixos  ~  ♥ 09:25  glxgears 
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
307 frames in 5.0 seconds = 61.201 FPS
284 frames in 5.0 seconds = 56.642 FPS

glxinfo -B:

rstasta@nixos  ~  ♥ 09:27  glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 8192 MB
    Total available memory: 8192 MB
    Currently available dedicated video memory: 7900 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 550.67
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 550.67
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 550.67
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

vulkaninfo --summary:

rstasta@nixos  ~  ♥ 09:28  vulkaninfo --summary
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /nix/store/hbm8axq521nvgjism7yw35fz9b9m9hk6-mesa-24.0.3-drivers/lib/libvulkan_virtio.so. Skipping this driver.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /nix/store/hbm8axq521nvgjism7yw35fz9b9m9hk6-mesa-24.0.3-drivers/lib/libvulkan_dzn.so. Skipping this driver.
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
ERROR: [../src/nouveau/vulkan/nvk_physical_device.c:935] Code 0 : VK_ERROR_INCOMPATIBLE_DRIVER
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.275


Instance Extensions: count = 23
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_EXT_surface_maintenance1            : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 4
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_portability_enumeration         : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6
VK_LUNARG_direct_driver_loading        : extension revision 1

Instance Layers: count = 8
--------------------------
VK_LAYER_INTEL_nullhw             INTEL NULL HW                1.1.73   version 1
VK_LAYER_MESA_device_select       Linux device selection layer 1.3.211  version 1
VK_LAYER_MESA_overlay             Mesa Overlay layer           1.3.211  version 1
VK_LAYER_NV_optimus               NVIDIA Optimus layer         1.3.277  version 1
VK_LAYER_VALVE_steam_fossilize_32 Steam Pipeline Caching Layer 1.3.207  version 1
VK_LAYER_VALVE_steam_fossilize_64 Steam Pipeline Caching Layer 1.3.207  version 1
VK_LAYER_VALVE_steam_overlay_32   Steam Overlay Layer          1.3.207  version 1
VK_LAYER_VALVE_steam_overlay_64   Steam Overlay Layer          1.3.207  version 1

Devices:
========
GPU0:
	apiVersion         = 1.3.274
	driverVersion      = 24.0.3
	vendorID           = 0x8086
	deviceID           = 0x9a60
	deviceType         = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
	deviceName         = Intel(R) UHD Graphics (TGL GT1)
	driverID           = DRIVER_ID_INTEL_OPEN_SOURCE_MESA
	driverName         = Intel open-source Mesa driver
	driverInfo         = Mesa 24.0.3
	conformanceVersion = 1.3.6.0
	deviceUUID         = 8680609a-0100-0000-0002-000000000000
	driverUUID         = c233f3f9-d8b0-7c0f-48fc-2df703b1b18b
GPU1:
	apiVersion         = 1.3.277
	driverVersion      = 550.67.0.0
	vendorID           = 0x10de
	deviceID           = 0x249d
	deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
	deviceName         = NVIDIA GeForce RTX 3070 Laptop GPU
	driverID           = DRIVER_ID_NVIDIA_PROPRIETARY
	driverName         = NVIDIA
	driverInfo         = 550.67
	conformanceVersion = 1.3.7.2
	deviceUUID         = 6cc7dba2-88c2-22f2-269b-fc44db0c8467
	driverUUID         = fe69d96c-763b-5724-837f-bf78daefd9e3
GPU2:
	apiVersion         = 1.3.274
	driverVersion      = 0.0.1
	vendorID           = 0x10005
	deviceID           = 0x0000
	deviceType         = PHYSICAL_DEVICE_TYPE_CPU
	deviceName         = llvmpipe (LLVM 17.0.6, 256 bits)
	driverID           = DRIVER_ID_MESA_LLVMPIPE
	driverName         = llvmpipe
	driverInfo         = Mesa 24.0.3 (LLVM 17.0.6)
	conformanceVersion = 1.3.1.1
	deviceUUID         = 6d657361-3234-2e30-2e33-000000000000
	driverUUID         = 6c6c766d-7069-7065-5555-494400000000
1 Like

That looks about right.

What I think is notable is that your iGPU is enumerated before the dGPU in VK but not in OGL. That smells like something that could cause a conflict?

I’m not sure whether Chrome uses Vulkan in any way but I’d try forcing the nvidia VK device. VK likely has an env var for that or at least one to disable the Intel ICD.

Speaking of the iGPU, could you try running all of this on the iGPU without any dGPU involved?

Beyond that, I don’t think we can help any further as the issue is likely with the Nvidia driver. The NVK message appears to always be printed when drivers are enumerated.

1 Like

Thanks for the hint. Can you please provide how to force nvidia VK device or how to run all on the iGPU? Or at least point me to where I can look for how to do it? Sorry, I am using nixos for about two weeks and I am still a learning noob

All of this probably has very little to do with NixOS itself.

As for the VK loader: Vulkan-Loader/docs/LoaderLayerInterface.md at f60412f5a62ab9c817355999d0858893db7d404b · KhronosGroup/Vulkan-Loader · GitHub

Ah, sorry; wrong doc. That’s layers, not drivers.

I have switched to zen kernel and it is slightly better. The errors are still there:

 rstasta@nixos  ~  ♥ 11:08  google-chrome-stable
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
[4562:4688:0330/110808.771270:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[4562:4688:0330/110808.771597:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[4562:4688:0330/110808.771901:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed

But at least it starts instantly, there are no nvidia errors in journalctl and I don’t need to wait three minutes

I have the same issue with multiple programs (rio terminal, a lot electron apps) running under Wayland. Did you solve this?