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

[ Split from pull #43 ] Add ioctl functions #44

Closed
wants to merge 44 commits into from

Conversation

Danysan1
Copy link
Contributor

@Danysan1 Danysan1 commented Jan 7, 2017

See radeon_ioctl.h for all the details of the ioctl functions.
Also, fix gcc 4.6 build in radeon_profile.h and radeon_profile.cpp.

@Danysan1
Copy link
Contributor Author

Danysan1 commented Jan 17, 2017

@marazmista the code is complete.
Ioctls allow to get most GPU informations without root. They also allow to read some GPU registers, including the status register, allowing to get the GPU usage.
Ioctls require libdrm headers (libdrm on Arch, libdrm-devel on Fedora, libdrm-dev on Debian).
Here is the feature matrix for each driver and Linux version:

Radeon (<3.15) Radeon (>=3.15) Radeon (>=4.1) Amdgpu (<4.10) Amdgpu (>=4.10)
Temperature ✔️
Core clock ✔️ ✔️
Memory clock ✔️ ✔️
Max core clock Need root ✔️ ✔️ ✔️ ✔️
VRAM size ✔️ ✔️
VRAM usage Need root ✔️ ✔️ ✔️ ✔️
GPU usage ✔️ ✔️ ✔️

I have tested all the functions on radeon driver.

PS: I added NO_IOCTL to the release defines because until we use the ioctls to effectively retrieve data there's no reason to add extra dependencies.

EDIT: Updated table

@Danysan1
Copy link
Contributor Author

Danysan1 commented Feb 6, 2017

Updated table:

| Driver Kernel | Radeon 3.7<=ver<3.15 | Radeon 3.15<=ver<4.1 | Radeon >=4.1 | Amdgpu 4.2<=ver<4.10 |
Amdgpu >=4.10 |
|---|:---:|:---:|:---:|:---:|:---:|
Temperature | ❌ | ❌ | ✔️ | ❌ | ❌ |
Core clock | ❌ | ❌ | ✔️ | ❌ | ✔️ |
Memory clock | ❌ | ❌ | ✔️ | ❌ | ✔️ |
Max core clock | Need root | ✔️ | ✔️ | ✔️ | ✔️ |
Max mem clock | ❌ | ❌ | ❌ | ✔️ | ✔️ |
Memory size | Need root | ✔️ | ✔️ | ✔️ | ✔️ |
Memory usage | Need root | ✔️ | ✔️ | ✔️ | ✔️ |
GPU usage | ❌ | ❌ | ✔️ | ✔️ | ✔️ |
Driver name | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

I tested the functions on radeon driver.

@Danysan1
Copy link
Contributor Author

Updated table:

| Driver Kernel | Radeon >=3.7 | Radeon >=3.15 | Radeon >=4.1 | Amdgpu >=4.2 |
Amdgpu >=4.10 | Amdgpu >= 4.12 |
|---|:---:|:---:|:---:|:---:|:---:|:---:|
Temperature | ❌ | ❌ | ✔️ | ❌ | ❌ | ✔️ |
Core clock | ❌ | ❌ | ✔️ | ❌ | ✔️ | ✔️ |
Memory clock | ❌ | ❌ | ✔️ | ❌ | ✔️ | ✔️ |
Max core clock | Root | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Max mem clock | ❌ | ❌ | ❌ | ✔️ | ✔️ | ✔️ |
Memory size | Root | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Memory usage | Root | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
GPU usage | ❌ | ❌ | ✔️ | ✔️ | ✔️ | ✔️ |
Driver name | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

@Danysan1
Copy link
Contributor Author

Danysan1 commented Jun 16, 2017

Closing because this is already being merged through branch rp-dev

@Danysan1 Danysan1 closed this Jun 16, 2017
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

Successfully merging this pull request may close these issues.

1 participant