VK_EXT_external_memory_dma_buf missing in 545

Hi, I’m on a freshly installed ubuntu 22.04 server, trying to run a program that uses VK_EXT_external_memory_dma_buf. vulkan-info shows the extension as missing, even though similar extensions such as VK_EXT_image_drm_format_modifier are present:

% vulkaninfo | grep -E 'dma|drm'
'DISPLAY' environment variable not set... skipping surface info
	VK_EXT_acquire_drm_display             : extension revision 1
	VK_EXT_image_drm_format_modifier              : extension revision 2
	VK_EXT_physical_device_drm        

The nvidia_drm module is definitely loaded. From dmesg:

[    1.790275] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  545.29.06  Thu Nov 16 01:47:29 UTC 2023
[    1.792492] [drm] [nvidia-drm] [GPU ID 0x00000005] Loading driver
[    1.792496] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:00:05.0 on minor 0

Additionally, if I skip the check for the extension in my application, VkPhysicalDeviceDrmPropertiesEXT is empty when used with GetPhysicalDeviceProperties2, even though that comes from the VK_EXT_physical_device_drm extension, which is present (and enabled).

Thanks in advance for any help you can provide!

nvidia-bug-report.log.gz (362.7 KB)

Is nvidia-drm being loaded with the modeset=1 parameter set? That’s a requirement for VK_EXT_external_memory_dma_buf.

@aplattner yes, as far as I can tell.

% lsmod | grep nvidia
nvidia_uvm           1777664  0
nvidia_drm            110592  0
nvidia_modeset       1339392  1 nvidia_drm
drm_kms_helper        249856  1 nvidia_drm
nvidia              56262656  2 nvidia_uvm,nvidia_modeset
drm                   700416  4 drm_kms_helper,nvidia,nvidia_drm
video                  73728  1 nvidia_modeset
% sudo grep -R nvidia /etc/modprobe.d
/etc/modprobe.d/nvidia-graphics-drivers-kms.conf:# This file was generated by nvidia-driver-545
/etc/modprobe.d/nvidia-graphics-drivers-kms.conf:options nvidia-drm modeset=1
/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb

Can you please try sudo cat /sys/module/nvidia_drm/parameters/modeset?

% sudo cat /sys/module/nvidia_drm/parameters/modeset
N

Is that N for NO? How can I enable it beyond what I’ve done already?

Is nvidia-drm.ko (or nvidia-drm.ko.zst or similar) in your initrd? You might need to run sudo update-initramfs to make sure the configuration in /etc/modprobe.d/* is copied into the initramfs.

If all else fails I think you can add nvidia-drm.modeset=1 to your kernel command line parameters from the bootloader.

Hm… update-initramfs -u and reboot fixed this bit:

% sudo cat /sys/module/nvidia_drm/parameters/modeset
Y

But the extension is still not available:

% vulkaninfo | grep dma
<nothing>

Hmm, okay. Does your user have access to the relevant /dev/dri/renderD* device file? You might need getfacl /dev/dri/* to see the extended attributes on them.

Aha! This led me to the answer:

% sudo getfacl /dev/dri/*
getfacl: Removing leading '/' from absolute path names
# file: dev/dri/by-path
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

# file: dev/dri/card0
# owner: root
# group: video
user::rw-
group::rw-
other::---

# file: dev/dri/renderD128
# owner: root
# group: render
user::rw-
group::rw-
other::---

I needed to usermod -aG render <myuser> and restart the shell. I had already added the user to the video group, but I didn’t know about the render group.

I apologize that it was such a basic oversight. Thanks so much for the help troubleshooting!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.