Skip to content

Commit

Permalink
Merge pull request #204 from Sonicadvance1/msm_support
Browse files Browse the repository at this point in the history
MSM and Adreno support
  • Loading branch information
Syllo committed May 21, 2023
2 parents 05539b1 + 6814ba5 commit 9b3c12c
Show file tree
Hide file tree
Showing 6 changed files with 651 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ endif()
option(NVIDIA_SUPPORT "Build support for NVIDIA GPUs through libnvml" ON)
option(AMDGPU_SUPPORT "Build support for AMD GPUs through amdgpu driver" ON)
option(INTEL_SUPPORT "Build support for Intel GPUs through i915 driver" ON)
option(MSM_SUPPORT "Build support for Adreno GPUs through msm driver" ON)

add_subdirectory(src)

Expand Down
10 changes: 10 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Table of Contents
- [AMD](#amd)
- [Intel](#intel)
- [NVIDIA](#nvidia)
- [Adreno](#adreno)
- [Build](#build)
- [Distribution Specific Installation Process](#distribution-specific-installation-process)
- [Ubuntu / Debian](#ubuntu--debian)
Expand Down Expand Up @@ -102,6 +103,15 @@ Kepler microarchitecture. Anything starting at GeForce 600, GeForce 800M and
successor should work fine. For more information about supported GPUs please
take a look at the [NVML documentation](http://docs.nvidia.com/deploy/nvml-api/nvml-api-reference.html#nvml-api-reference).

### Adreno

NVTOP supports Adreno GPUs using the `msm` linux driver.

msm introduced the fdinfo interface in kernel 6.0 ([browse kernel
source](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/msm/msm_drv.c?h=linux-6.0.y)).
Hence, you will need a kernel with a version greater or equal to 6.0 to see the
processes using Adreno GPUs.

Build
-----

Expand Down
17 changes: 12 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,24 @@ if(AMDGPU_SUPPORT OR INTEL_SUPPORT)
target_sources(nvtop PRIVATE device_discovery_linux.c)
endif()

if(AMDGPU_SUPPORT)
if(AMDGPU_SUPPORT OR MSM_SUPPORT)
# Search for libdrm for AMDGPU support
find_package(Libdrm)

if(Libdrm_FOUND)
message(STATUS "Found libdrm; Enabling AMDGPU support")
message(STATUS "Found libdrm; Enabling support")
target_include_directories(nvtop PRIVATE ${Libdrm_INCLUDE_DIRS})
target_sources(nvtop PRIVATE extract_gpuinfo_amdgpu.c)
target_sources(nvtop PRIVATE extract_gpuinfo_amdgpu_utils.c)
if (AMDGPU_SUPPORT)
target_sources(nvtop PRIVATE extract_gpuinfo_amdgpu.c)
target_sources(nvtop PRIVATE extract_gpuinfo_amdgpu_utils.c)
endif()

if (MSM_SUPPORT)
target_sources(nvtop PRIVATE extract_gpuinfo_msm.c)
target_sources(nvtop PRIVATE extract_gpuinfo_msm_utils.c)
endif()
else()
message(FATAL_ERROR "libdrm not found; This library is required for AMDGPU support")
message(FATAL_ERROR "libdrm not found; This library is required for AMDGPU and MSM support")
endif()
endif()

Expand Down
Loading

0 comments on commit 9b3c12c

Please sign in to comment.