Libdrm /drm.h No such file or directory!

I was trying to compile the RadeonGFX Build.sh from X547 and got to compiling libdrm2 and the compiler quit with an error…

failed: amdgpu/libdrm_amdgpu.so.1.0.0.p/amdgpu_asic_id.c.o cc -Iamdgpu/libdrm_amdgpu.so.1.0.0.p -Iamdgpu -I…/amdgpu -Iheaders -I…/headers -I/boot/home/brg/install/develop/headers/accelerant -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -include amdgpu/config.h -fPIC -Wsign-compare -Werror=undef -Werror=implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Winline -Wshadow -Wdeclaration-after-statement -Wold-style-definition -Wno-unused-parameter -Wno-attributes -Wno-long-long -Wno-missing-field-initializers ‘-DAMDGPU_ASIC_ID_TABLE=“/boot/home/brg/install/data/libdrm/amdgpu.ids”’ -MD -MQ amdgpu/libdrm_amdgpu.so.1.0.0.p/amdgpu_asic_id.c.o -MF amdgpu/libdrm_amdgpu.so.1.0.0.p/amdgpu_asic_id.c.o.d -o amdgpu/libdrm_amdgpu.so.1.0.0.p/amdgpu_asic_id.c.o -c …/amdgpu/amdgpu_asic_id.cIn file included from …/amdgpu/amdgpu_asic_id.c:35:…/amdgpu/amdgpu_internal.h:31:10: fatal error: libdrm/drm.h: No such file or directory 31 | #include%20%3Clibdrm/drm.h%3E%20%20%20%20%20%20|%20%20%20%20%20%20%20%20%20%20^~~~~~~~~~~~~~compilation%20terminated.[9/31]%20Compiling%20C++%20object%20subprojects/ThreadLink/libThreadLink.a.p/ClientThreadLink.cpp.oninja:%20build%20stopped:%20subcommand%20failed.

When I check my install path I see drm.h in install/develop/headers/ path! I’m kind of confuse here. Do I need to add -D options in configuring libdrm2?

2 Likes

Hello ,

I’m not a developer, but I suggest to share more info about your situation I mean your config and what you want to achieve.
Do you compile on Haiku ? On bare metal ? in a VM ? For which type of platform / architecture ?

I just know X547 is used by X512 for some developments of many he has - on GitHub -, but as he has more several developments parallel, you may need some additional info to use the codes to build it.
He has Wayland porting project, and several other video related projects too to have working 3D acceleration.
However now he works heavily on Haiku Risc-V boot and bootable image completion - to complete Haiku image - to have that available for Risc V just as for already supported platforms : x86 and especially for x86_64.

I assume @X512 reads the forum but might not your post is the most interesting titled for him.

2 Likes

I’m running Haiku on bare metal. I did a listdev here.

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1510: Family 14h Processor Root Complex

device Display controller (VGA compatible controller, VGA controller) [3|0|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 9802: Wrestler [Radeon HD 6310]

device Mass storage controller (SATA controller, AHCI 1.0) [1|6|1]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4391: SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]

device Serial bus controller (USB controller, OHCI) [c|3|10]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4397: SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

device Serial bus controller (USB controller, EHCI) [c|3|20]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4396: SB7x0/SB8x0/SB9x0 USB EHCI Controller

device Serial bus controller (SMBus) [c|5|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4385: SBx00 SMBus Controller

device Multimedia controller (Audio device) [4|3|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4383: SBx00 Azalia (Intel HDA)

device Bridge (ISA bridge) [6|1|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 439d: SB7x0/SB8x0/SB9x0 LPC host controller

device Bridge (PCI bridge, Subtractive decode) [6|4|1]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4384: SBx00 PCI to PCI Bridge

device Serial bus controller (USB controller, OHCI) [c|3|10]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4399: SB7x0/SB8x0/SB9x0 USB OHCI2 Controller

device Bridge (PCI bridge, Normal decode) [6|4|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 43a0: SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0)

device (Unknown) (255:0:0) [ff|0|0]
vendor 10ec: Realtek Semiconductor Co., Ltd.
device 5209: RTS5209 PCI Express Card Reader

device Bridge (PCI bridge, Normal decode) [6|4|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 43a1: SB700/SB800/SB900 PCI to PCI bridge (PCIE port 1)

device Network controller (Ethernet controller) [2|0|0]
vendor 10ec: Realtek Semiconductor Co., Ltd.
device 8136: RTL810xE PCI Express Fast Ethernet controller

device Bridge (PCI bridge, Normal decode) [6|4|0]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 43a3: SB900 PCI to PCI bridge (PCIE port 3)

device Network controller [2|80|0]
vendor 168c: Qualcomm Atheros
device 002b: AR9285 Wireless Network Adapter (PCI-Express)

device Serial bus controller (USB controller, OHCI) [c|3|10]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4397: SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

device Serial bus controller (USB controller, EHCI) [c|3|20]
vendor 1002: Advanced Micro Devices, Inc. [AMD/ATI]
device 4396: SB7x0/SB8x0/SB9x0 USB EHCI Controller

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1700: Family 12h/14h Processor Function 0

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1701: Family 12h/14h Processor Function 1

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1702: Family 12h/14h Processor Function 2

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1703: Family 12h/14h Processor Function 3

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1704: Family 12h/14h Processor Function 4

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1718: Family 12h/14h Processor Function 6

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1716: Family 12h/14h Processor Function 5

device Bridge (Host bridge) [6|0|0]
vendor 1022: Advanced Micro Devices, Inc. [AMD]
device 1719: Family 12h/14h Processor Function 7

device Unclassified device (Non-VGA unclassified device) [0|0|0]
vendor 0000: Unknown
device 0000: Unknown

1 Like

The gist seems to be outdated. Last update is from Jan 17, and his libdrm2 repo has a commit from Jan 22 named “make independent from libdrm, use pointer to aacelerant” . The component and header from the error (amdgpu_asic_id.c, amdgpu_internal.h) were introduced there.
X512 might give you more details or instructions, but maybe amdgpu_internal.h should include drm.h instead of libdrm/drm.h, or maybe the current state of the repo is more experimental than usual and you should checkout a previous commit.

6 Likes