Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 768549 - app-misc/radeontop-1.3 : amdgpu.c: fatal error: libdrm/amdgpu.h: No such file or directory
Summary: app-misc/radeontop-1.3 : amdgpu.c: fatal error: libdrm/amdgpu.h: No such file...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Mair-Keimberger (iamnr3)
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-02-03 19:15 UTC by Toralf Förster
Modified: 2021-04-16 23:34 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,15.35 KB, text/plain)
2021-02-03 19:15 UTC, Toralf Förster
Details
app-misc:radeontop-1.3:20210203-172831.log (app-misc:radeontop-1.3:20210203-172831.log,5.34 KB, text/plain)
2021-02-03 19:15 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,19.24 KB, text/plain)
2021-02-03 19:15 UTC, Toralf Förster
Details
environment (environment,52.36 KB, text/plain)
2021-02-03 19:15 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,12.29 KB, application/x-bzip)
2021-02-03 19:15 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,14.17 KB, application/x-bzip)
2021-02-03 19:15 UTC, Toralf Förster
Details
patch: app-misc/radeontop: fix build without amdgpu, really fixes #768549 (radeontop-768549.patch,3.32 KB, patch)
2021-02-17 14:23 UTC, Jernej Jakob
Details | Diff
patch: app-misc/radeontop: fix build without amdgpu, really fixes #768549 (better version) (radeontop-768549_v2.patch,3.32 KB, patch)
2021-02-17 14:34 UTC, Jernej Jakob
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2021-02-03 19:15:21 UTC
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -fno-diagnostics-color  -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections  -I/usr/include/libdrm   -DENABLE_XCB=1 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600  -DENABLE_NLS=1 -DHAS_DRMGETDEVICE=1 -DENABLE_AMDGPU=1   -c -o amdgpu.o amdgpu.c
amdgpu.c:20:10: fatal error: libdrm/amdgpu.h: No such file or directory
   20 | #include <libdrm/amdgpu.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no-multilib-20210203-084956

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-10.2.0 *
Python 3.8.7
The following VMs are available for generation-2:
*)	AdoptOpenJDK 8.272_p10 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8  system-vm


  timestamp(s) of HEAD at this tinderbox image:
/var/db/repos/gentoo	Wed Feb  3 15:47:44 UTC 2021

emerge -qpvO app-misc/radeontop
[ebuild  N    ] app-misc/radeontop-1.3  USE="nls"
Comment 1 Toralf Förster gentoo-dev 2021-02-03 19:15:22 UTC
Created attachment 685683 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2021-02-03 19:15:23 UTC
Created attachment 685686 [details]
app-misc:radeontop-1.3:20210203-172831.log
Comment 3 Toralf Förster gentoo-dev 2021-02-03 19:15:24 UTC
Created attachment 685689 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2021-02-03 19:15:26 UTC
Created attachment 685692 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2021-02-03 19:15:27 UTC
Created attachment 685695 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2021-02-03 19:15:28 UTC
Created attachment 685698 [details]
temp.tar.bz2
Comment 7 Arnim Eijkhoudt 2021-02-03 21:39:10 UTC
It seems this can be fixed by recompiling x11-libs/libdrm after adding 'amdgpu' to the VIDEO_CARDS="... amdgpu ..." variable in make.conf. This will provide the missing libdrm/amdgpu.h include, and allows app-misc/radeontop to compile successfully.
Comment 8 Toralf Förster gentoo-dev 2021-02-04 00:04:16 UTC
(In reply to Arnim Eijkhoudt from comment #7)
> It seems this can be fixed by recompiling x11-libs/libdrm after adding
> 'amdgpu' to the VIDEO_CARDS="... amdgpu ..." variable in make.conf. This
> will provide the missing libdrm/amdgpu.h include, and allows
> app-misc/radeontop to compile successfully.

FWIW the tinderbox sets

data/package.use.90common:*/*  VIDEO_CARDS: -* dummy
Comment 9 Michael Mair-Keimberger (iamnr3) 2021-02-06 15:54:00 UTC
(In reply to Arnim Eijkhoudt from comment #7)
> It seems this can be fixed by recompiling x11-libs/libdrm after adding
> 'amdgpu' to the VIDEO_CARDS="... amdgpu ..." variable in make.conf. This
> will provide the missing libdrm/amdgpu.h include, and allows
> app-misc/radeontop to compile successfully.

Thanks for the input and thanks for testing @Toralf
I've created a PR which should fix this issue. Since this tool is only useful in combination with amd radeon gpus i've simply added the dependency on amdgpu/radeon.
Comment 10 Jernej Jakob 2021-02-17 13:33:49 UTC
That PR did not fix the problem.

Package:    app-misc/radeontop-1.3-r1
USE:        abi_x86_64 amd64 elibc_glibc kernel_linux nls userland_GNU video_cards_radeon

libdrm/amdgpu.h: No such file or directory

To me it seems like the problem is -DENABLE_AMDGPU=1 is being set when it should not be.
Comment 11 Jernej Jakob 2021-02-17 14:23:02 UTC
Created attachment 687279 [details, diff]
patch: app-misc/radeontop: fix build without amdgpu, really fixes #768549
Comment 12 Jernej Jakob 2021-02-17 14:34:16 UTC
Created attachment 687282 [details, diff]
patch: app-misc/radeontop: fix build without amdgpu, really fixes #768549 (better version)

Modified so it better fits existing syntax
Comment 13 Larry the Git Cow gentoo-dev 2021-02-17 19:33:10 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d50c2b42a4b140da2c9dba85542ec5bba82b84bf

commit d50c2b42a4b140da2c9dba85542ec5bba82b84bf
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2021-02-17 19:27:00 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2021-02-17 19:32:50 +0000

    app-misc/radeontop: fix build without amdgpu
    
    Really fixes #768549.
    
    Bug: https://bugs.gentoo.org/768549
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Signed-off-by: Jernej Jakob <jernej.jakob@gmail.com>
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 app-misc/radeontop/radeontop-1.3-r2.ebuild | 57 ++++++++++++++++++++++++++++++
 app-misc/radeontop/radeontop-9999.ebuild   |  2 +-
 2 files changed, 58 insertions(+), 1 deletion(-)