Bug 101564 - mesa-noglvnd undefined reference to `drmGetDevices2'
Summary: mesa-noglvnd undefined reference to `drmGetDevices2'
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: 17.1
Hardware: Other All
: medium normal
Assignee: Emil Velikov
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 12:27 UTC by kusayu
Modified: 2017-07-06 00:00 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description kusayu 2017-06-23 12:27:57 UTC
I have a problem building mose-noglvnd from AUR on Arch
What info should i provide? Ho can i fix it?

  CXXLD    vulkan/libvulkan_intel.la
vulkan/.libs/libvulkan_common.a(vulkan_libvulkan_common_la-anv_device.o): In function `anv_EnumeratePhysicalDevices':
anv_device.c:(.text+0x45a): undefined reference to `drmGetDevices2'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:2425: vulkan/libvulkan_intel.la] Error 1
make[4]: Leaving directory '/home/kusayu/.cache/pacaur/mesa-noglvnd/src/mesa-17.1.0/src/intel'
make[3]: *** [Makefile:1972: all] Error 2
make[3]: Leaving directory '/home/kusayu/.cache/pacaur/mesa-noglvnd/src/mesa-17.1.0/src/intel'
make[2]: *** [Makefile:851: all-recursive] Error 1
make[2]: Leaving directory '/home/kusayu/.cache/pacaur/mesa-noglvnd/src/mesa-17.1.0/src'
make[1]: *** [Makefile:642: all] Error 2
make[1]: Leaving directory '/home/kusayu/.cache/pacaur/mesa-noglvnd/src/mesa-17.1.0/src'
make: *** [Makefile:642: all-recursive] Error 1

$ pacsearch libdrm
extra/libdrm 2.4.81-1 [installed]
    Userspace interface to kernel DRM services
multilib/lib32-libdrm 2.4.81-1 [installed]
    Userspace interface to kernel DRM services (32-bit)

$ ls /usr/lib | grep drm.so
libdrm.so
libdrm.so.2
libdrm.so.2.4.0
libva-drm.so
libva-drm.so.1
libva-drm.so.1.4000.0
Comment 1 Kenneth Graunke 2017-06-23 17:45:16 UTC
that's odd, libdrm 2.4.81 does include drmGetDevices2, and anv_device.c is properly including xf86drm.h...

Are you sure you don't have an old copy of libdrm getting picked up somehow?
Comment 2 Emil Velikov 2017-06-26 11:14:04 UTC
Assuming that by "mose-noglvnd" you meant "mesa-noglvnd" aka [1].

Kenneth is spot on here - barring any local issues things should build fine.

Things to check:
 - for libdrm.so* files across across the whole system
Only ones in /usr/lib{,32} should exist
 - that the files are from the official package
You may have overwritten them by mistake
 - try latest release 17.1.3
17.1.0 was released month and a half ago
 - do _not_ run autoreconf

Please try to push the last two fixes to the AUR package.


[1] https://aur.archlinux.org/packages/mesa-noglvnd/
Comment 3 Filipp 2017-06-29 17:21:44 UTC
I have seen the same issue during lauch steam in console:
Running Steam on chakra 2015.03 64-bit
"STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1496897923)
Installing breakpad exception handler for appid(steam)/version(1496897923)
Installing breakpad exception handler for appid(steam)/version(1496897923)
Failed to load steamui.so - dlerror(): /usr/lib32/libgbm.so.1: undefined symbol: drmGetDevice2"

This happens after installation lib32-mesa-noglvnd 17.1.0-1 (output for "pacman -Qo /usr/lib32/libgbm.so.1" command):
/usr/lib32/libgbm.so.1 belongs to lib32-mesa-noglvnd 17.1.0-1

I am using catalyst.
Comment 4 Emil Velikov 2017-06-30 07:31:50 UTC
Filipp did you try the suggestions in Comment 2?

What happens when you rebuild any AUR packages that use libdrm while amending the PKGBUILD to check/require libdrm>=2.4.75

Besides that, I'm not sure how much help we con offer - the packages mentioned are unofficial and seem rather buggy. While I want things to work everywhere, the [AUR] package maintainers should fix some issues on their end first.

Brief list (omitting lib32- for brevity)
mesa-noglvnd/friends:
 - outright removes the gbm_bo_create_with_modifiers() call from EGL/drm
This is a _serious_ no-go.
 - foo-noglvnd packages depend on normal mesa ones

catalyst-utils
 - backwards dependencies - (opt)depends on catalyst-libgl/opencl-catalyst

catalyst-firepro
 - package parses user config and magically promotes itself to +multilib
 - one package for everything, convoluted deps/provides/etc lists.
Comment 5 Filipp 2017-07-01 19:58:35 UTC
Thanks for your comment,

Just to add some info regarding to setup, 
There are libdrm.so, libdrm.so.2 and libdrm.so.2.4.0 in /usr/lib/ and the same in /usr/lib32/ folder. Looks that the last two .so can be removed.

I am not able to check with libdrm>=2.4.75 for now, since libdrm-2.4.71 is installed. (from official repo, but catalyst is installed from Vi0L0 repo).

The issue was resolved by reverting to lib32-mesa-noglvnd-17.0.5-1 for me. And going to wait till new libdrm or 17.1.3 comes in repos.
Comment 6 Emil Velikov 2017-07-03 13:19:20 UTC
Filipp, Arch had 2.4.75 since late Jan, 2017.

If you're still on 2.4.71 it sounds like you've got partial update, which is not supported by Arch [1]. Which is not something we can fix :-\


[1] https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.