Skip to content

Commit

Permalink
v0.1 Initial commit
Browse files Browse the repository at this point in the history
Happy Chinese Newyear!

Signed-off-by: Jiaxun Yang <[email protected]>
  • Loading branch information
FlyGoat committed Feb 4, 2019
1 parent 736e887 commit 9e3feb8
Show file tree
Hide file tree
Showing 15 changed files with 1,558 additions and 1 deletion.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

#define project name
PROJECT(ryzenadj)

SET(CMAKE_CXX_FLAGS "-std=c++11")

SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

SET(INC_DIR ./inc)
SET(LINK_DIR ./prebuilt)

INCLUDE_DIRECTORIES(${INC_DIR})
LINK_DIRECTORIES(${LINK_DIR})

AUX_SOURCE_DIRECTORY(./ SRC_DIR)

if(WIN32)
ADD_EXECUTABLE(${PROJECT_NAME} winring0.cpp nb_smu_ops.cpp argparse.cpp main.cpp)
target_link_libraries(${PROJECT_NAME} WinRing0x64)
else()
ADD_EXECUTABLE(${PROJECT_NAME} libpci.cpp nb_smu_ops.cpp argparse.cpp main.cpp)
target_link_libraries(${PROJECT_NAME} pci)
endif()
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# RyzenAdj
Adjust power management settings for Ryzen Processors
Adjust power management settings for Ryzen Processors.

Based on: [FlyGoat/ryzen_nb_smu](https://github.com/flygoat/ryzen_nb_smu)

## Usage
The command line interface is identical on both Windows and Unix-Like OS.

You should run it with Administrator on Windows or root on Linux.

You can write a shell script or bat to do it automaticly.

```
$./ryzenadj -h
Usage: ryzenadj [options] [[--] args]
or: ryzenadj [options]
Ryzen Power Management adjust tool.
-h, --help show this help message and exit
Options
-i, --info Show information (W.I.P.)
Settings
-a, --stapm-limit=<u32> Sustained power limit (10e-3 W)
-b, --fast-limit=<u32> Fast PPT power limit (10e-3 W)
-c, --slow-limit=<u32> Slow PPT power limit (10e-3 W)
-d, --slow-time=<u32> Slow PPT constant time
-e, --stapm-time=<u32> STAMP constant time
-f, --tctl-temp=<u32> Tctl temperature (℃)
```

### demo
If I'm going to set all the Power Limit to 45W, and Tctl to 90 ℃,
then the command line should be:
```
./ryzenadj --stapm-limit=45000 --fast-limit=45000 --slow-limit=45000 --tctl-temp=90
```

## Build
### Linux
This project is using cmake, you can search for guides online about how to compile a cmake based program.

Please ensure you have libpci depdency before compile.

### Windows
It can be built by Visual Studio automaticly. However, as for now, MingW can't be used to compile for some reason.

Required dll is included in ./prebuilt of source tree. Please put the dll library and sys driver in the same folder with ryzenadj.exe.

## TODO
- Determine the unit of time
- Add more options
- Code cleanup (The original program was written in C but now it's C++ in order to call VC++ library)

Loading

0 comments on commit 9e3feb8

Please sign in to comment.