GPUをRadeon RX 560に換装したところ、Linux Mint 18.3に配信されているRadeontop ではGPUの使用率を計測できなくなってしまいました。v0.9とのことです。
GitHubを確認してみると、つい最近にv1.1がリリースされた模様です。ただし、debファイルではなくソースコードのみでした。
ワタクシ、ソースからモジュールを生成したことがないので、これはちょっとハードルが高いです。
しかし、意を決してコンパイル方法を調べてみたところ、意外と簡単でした。Makefileが置いてあるディレクトリに移動して、以下のコマンドを実行するだけでした。
sudo make
sudo make install
典型的な「食わず嫌い」 ですね。
というわけで、意を決してmakeしてみたところ、コンパイルエラーが発生しました。コンパイルエラーなんて心が折れそうです。
radeontop-master $ sudo make
./getver.sh
Package pciaccess was not found in the pkg-config search path.
Perhaps you should add the directory containing `pciaccess.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pciaccess' found
Package libdrm was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdrm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdrm' found
Package xcb was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb' found
Package xcb-dri2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-dri2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-dri2' found
cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -DENABLE_XCB=1 -DENABLE_NLS=1 -s -c -o detect.o detect.c
In file included from include/radeontop.h:23:0,
from detect.c:17:
include/gettext.h:28:22: fatal error: libintl.h: そのようなファイルやディレクトリはありません
compilation terminated.
<ビルトイン>: ターゲット 'detect.o' のレシピで失敗しました
make: *** [detect.o] エラー 1
libintl.hというファイルが足りないそうです。 へぇ、何のファイルなんですか?これは?
調べてみると、libc6-devというパッケージをインストールすれば良いようです。
apt install libc6-dev
では、もう一度makeしてみると、今度は別なコンパイルエラーとなりました。別なエラーなので先に進んだと感じた反面、また謎の状況にハマったとも感じてしまいます。心が折れそうです。
radeontop-master $ sudo make今度はxf86drm.hというファイルが足りないそうです。これも調べてみるとlibdrm-devというパッケージをインストールすれば良いようです。
./getver.sh
Package pciaccess was not found in the pkg-config search path.
Perhaps you should add the directory containing `pciaccess.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pciaccess' found
Package libdrm was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdrm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdrm' found
Package xcb was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb' found
Package xcb-dri2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-dri2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-dri2' found
cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -DENABLE_XCB=1 -DENABLE_NLS=1 -s -c -o detect.o detect.c
In file included from detect.c:17:0:
include/radeontop.h:36:21: fatal error: xf86drm.h: そのようなファイルやディレクトリはありません
compilation terminated.
<ビルトイン>: ターゲット 'detect.o' のレシピで失敗しました
make: *** [detect.o] エラー 1
・・・・次のエラーがやって来ました。
radeontop-master $ sudo make
./getver.sh
Package pciaccess was not found in the pkg-config search path.
Perhaps you should add the directory containing `pciaccess.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pciaccess' found
Package xcb was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb' found
Package xcb-dri2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-dri2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-dri2' found
cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -DENABLE_NLS=1 -s -c -o detect.o detect.c
detect.c:18:23: fatal error: pciaccess.h: そのようなファイルやディレクトリはありません
compilation terminated.
<ビルトイン>: ターゲット 'detect.o' のレシピで失敗しました
make: *** [detect.o] エラー 1
次はpciaccess.hというファイルが足りないそうです。こちらはlib-pciaccess-devというパッケージで解決です。
しかし、まだコンパイルエラーは収まりません。そろそろ心が折れそうです。
radeontop-master $ sudo make
./getver.sh
Package xcb was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb' found
Package xcb-dri2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-dri2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-dri2' found
cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -DENABLE_NLS=1 -s -c -o detect.o detect.c
Package xcb was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb' found
Package xcb-dri2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-dri2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-dri2' found
cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -DENABLE_NLS=1 -s -c -o ticks.o ticks.c
Package xcb was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb' found
Package xcb-dri2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-dri2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-dri2' found
cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -DENABLE_NLS=1 -s -c -o ui.o ui.c
ui.c:18:21: fatal error: ncurses.h: そのようなファイルやディレクトリはありません
compilation terminated.
<ビルトイン>: ターゲット 'ui.o' のレシピで失敗しました
make: *** [ui.o] エラー 1
ここで心が折れました。今日はもう勘弁してください。