-
Notifications
You must be signed in to change notification settings - Fork 37
Build Instructions
Please modify this document if you hit any difficulties following it.
These instructions describe building and installing gputop to ~/local/gputop in your home directory and assume that your PATH and LD_LIBRARY_PATH environment variables are setup so you can run things from there once installed. If you don't already have your own way of managing separate install prefixes for projects then you can create a ~/local/bashrc file like:
export PATH=~/local/bin:$PATH
export LD_LIBRARY_PATH=~/local/lib:$LD_LIBRARY_PATH
and the instructions below then assume that this file has been evaluated in your current shell e.g. with:
source ~/local/bashrc
Or
. ~/local/bashrc
GPUTop uses the meson build system. On a recent distribution you can install meson with :
sudo apt-get install meson
Alternatively you can use the pip distribution mechanism :
sudo pip3 install meson
GPUTop has minimal dependencies :
sudo apt-get install libssl-dev
If you want to build the UI, also install the following dependencies :
sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev libglfw3-dev libepoxy-dev
Some parts of the GPUTop UI rely on 'i915 perf' features that are not yet upstream. To enable all of the features built into the UI, should checkout the kernel at the following location : https://github.com/djdeath/linux And build the wip/djdeath/oa-next branch.
Otherwise a stable kernel 4.13+ will give basic functionalities. A kernel 4.15+ will give the ability to list processes.
Checkout and configure :
git clone https://github.com/rib/gputop
cd gputop
meson . build
If you also want to build the GPUTop UI run :
meson . build -Dnative_ui=true
Okay, build and install gputop:
ninja -C build
ninja -C build install
Running gputop
without any options should result in a server listening on port 7890 by default.
Also check gputop --help
in case there are new things not mentioned here.
Notably gputop is just a convenience for setting various environment variables before running some other command you are interested in profiling. Running gputop [OPTIONS...] --dry-run
will show what's done under the hood and show how the equivalent environment can be setup if you need to run under gdb or valgrind.
Once the gputop server is running then there are a number of clients that can be used to connect and visualize the available metrics.
It is recommended to run GPUTop as root.
Assuming the web ui hasn't been built so far it's still possible to connect to the gputop server using the UI hosted on github by browsing to https://gputop.com?remoteHost=127.0.0.1&remotePort=7890.
If the web ui has been built then instead browse to http://localhost:7890
gputop-wrapper
is a tool that can connect to the gputop server and log metrics in a CSV output format. For example run as:
gputop-wrapper -m RenderBasic -c Timestamp,EuActive -o eu-active-log.csv
See gputop-wrapper --help
for more details. Running gputop-wrapper
without arguments tries to help you discover what metrics are available and gputop -m RenderBasic
can explicitly query the available metric sets and counters.
The process of building the Web UI is similar to a normal build. It just requires to install the emscripten compiler.
cd /opt && curl https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | tar xvz
cd /opt/emsdk-portable && ./emsdk install sdk-1.37.27-64bit
chmod go+rX -R /opt/emsdk-portable
meson . build-webui -Dwebui=true --cross=scripts/meson-cross/emscripten-docker-debug.txt
ninja -C build-webui
Then copy the generated files :
cp build-webui/gputop-ui/* gputop-ui/
Finally you can serve the UI from the gputop-ui directory with a web server of your choice.