Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `amdgpu_device_get_fd' #17

Closed
CabbageSong opened this issue May 18, 2023 · 6 comments
Closed

undefined reference to `amdgpu_device_get_fd' #17

CabbageSong opened this issue May 18, 2023 · 6 comments

Comments

@CabbageSong
Copy link

When building with cargo install --locked --path ., an error launched with

undefined reference to `amdgpu_device_get_fd'

I saw amdgpu_device_get_fd was push to drm 18 months ago, but still not found in my local OS.

ps. I'm running 20.04.6, kernel version 5.15.0-72-generic

@Umio-Yasuno
Copy link
Owner

Could you try this branch?
https://github.com/Umio-Yasuno/amdgpu_top/tree/fd

@Umio-Yasuno
Copy link
Owner

amdgpu_device_get_fd was added since libdrm-2.4.109.
https://gitlab.freedesktop.org/mesa/drm/-/commit/f70e8ae83590d2a1fb1972dc7e875dd6a9355b77

libdrm-amdgpu-sys-rs used amdgpu_device_get_fd internally, which is replaced by this commit.
Umio-Yasuno/libdrm-amdgpu-sys-rs@ba36fab

@CabbageSong
Copy link
Author

Could you try this branch? https://github.com/Umio-Yasuno/amdgpu_top/tree/fd

Hi @Umio-Yasuno , thanks for your reply. It does work for me!

libdrm-2.4.107 is the latest package for ubuntu 20.04. I guess that's the reason why 'amdgpu_device_get_fd' is lost.

@CabbageSong
Copy link
Author

BTW, I'm not sure if it is still the issue of ubuntu version. The data under fdinfo is 0 for all:
image

In addition, I found that headers are different in fdinfo:

~/amdgpu_top$ cat /proc/4728/fdinfo/7
pos:    0
flags:  02100002
mnt_id: 26
ino:    623
pdev:   0000:04:00.0
pasid:  32774
vram mem:       17196 kB
gtt mem:        6144 kB
cpu mem:        0 kB
gfx0:   70.59%

It seems that data is behind vram mem and the parser is searching with drm-memory

@Umio-Yasuno
Copy link
Owner

The AMDGPU driver has changed the format of fdinfo to fix the calculation of engine usage.
It now uses the format along "drm-usage-stat.rst".
However, in Linux Kernel 5.15.xxx, the old format is still used.
I am not going to support the old format.

https://lists.freedesktop.org/archives/amd-gfx/2022-May/079291.html
https://docs.kernel.org/gpu/drm-usage-stats.html

@CabbageSong
Copy link
Author

Okay. I'll try to install Ubuntu22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants