Current filter: »Intel« (Click tag to exclude it or click a conjunction to switch them.)
May 24, 2023
HP Probook 450 G9, mpd, libsamplerateで高品質アップサンプリングを試みる(6月1日、4日、追記)
前回のエントリーでは、TC64-11.1 mpdサーバーをHP Probook 450 G9で動かした。
どこまでやれるか試しているのだが、ここで問題がある。
カタログ上、450 G9のCPUは最高4.9GHzで動く筈だが、3.7GHzまででしか動いてくれない。
インテルのCPUにはターボ・ブースト・テクノロジーというのがあって、負荷がかかると自動的にクロック周波数を上げるのだけど、それが充分に機能してない?ようなのだ。
原因が分からない。
ネット上で調べたところ、原因として考えられるのは、熱の問題、電力の問題、BIOSのバグ、これらは該当しないだろう。
あと、AVX2、AVX-512のような遅いSIMDがクロックを下げるとか。
これはよく分からない。アクティブなコアが増加するとクロック周波数の上昇率が下がるということらしいが、mpdサーバーで動いているプロセスは少ない。
ほとんどのコアは仕事をしてないようにすら見えるので、これも違う気がする。
うちのmpdサーバー EliteBook 820 G2の状況をメモ。
tc@box:~$ grep MHz /proc/cpuinfo cpu MHz : 2886.755 cpu MHz : 2831.833 cpu MHz : 2697.611 cpu MHz : 2694.282 tc@box:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor powersave powersave powersave powersave tc@box:~$ grep 'model name' /proc/cpuinfo model name : Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz model name : Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz model name : Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz model name : Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz tc@box:~$
powersaveで動いている。
CPUは2.30GHzだが、動くときには2.8GHz以上で動いている。i5-5300Uのターボ・ブースト利用時の最大周波数は2.90 GHzであり、ブーストが機能している。
(powersaveでもブーストは効くんだね)
そういうわけで、Probook 450 G9のi7-1255Uでターボ・ブーストが機能しない?のが残念な状況だ。
正直、買って試してみないと分からないな、というのはあったので想定内といえばそうなんだけど、820 G2で動いてるんだから多分いけるだろう、と甘い判断をしたわけだ。、、
Probook 450 G9をmpdサーバーとして動かしてみたときの状況。
tc@box:~$ grep MHz /proc/cpuinfo cpu MHz : 2608.375 cpu MHz : 2643.276 cpu MHz : 3700.000 cpu MHz : 3700.000 cpu MHz : 820.543 cpu MHz : 1357.115 cpu MHz : 2889.705 cpu MHz : 1141.198 cpu MHz : 2205.000 cpu MHz : 2569.790 cpu MHz : 1859.254 cpu MHz : 888.040 tc@box:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor powersave *snip* tc@box:~$ grep 'model name' /proc/cpuinfo model name : 12th Gen Intel(R) Core(TM) i7-1255U *snip* tc@box:~$
こんな感じで3.7GHzが上限になっている様だ。なんでかねえ、、、
https://www.intel.co.jp/content/www/jp/ja/products/sku/226259/intel-core-i71255u-processor-12m-cache-up-to-4-70-ghz/specifications.html
インテル® Core™ i7-1255U プロセッサー
上記のインテルのサイトによると、
Performance-coresの数 2、Efficient-coresの数 8
Performance-core最大ターボ・フリークエンシー 4.70 GHz
Efficient-core のターボ・ブースト利用時の最大フリークエンシー 3.50 GHz
とある。
https://xtech.nikkei.com/atcl/nxt/column/18/02268/111800001/
最新のインテルCPU、第12世代Coreシリーズは何が違うのか
日経クロステック 2022.12.12
上記記事によると第12世代のインテルCPU、つまりi7-1255Uは、PコアとEコア、2種類のコアを積んでいると。
高い性能が必要な処理はPコア、負荷は低いが常時実行するような処理はEコアが向いているそうだ。
性能を重視した従来のCPUコアがPコアであり、性能よりも電力効率を重視したのがEコアで物理的サイズはPコアの4分の1と。
そんな構造なので、スレッドごとの処理を適切なコアに割り振る「スレッド・ディレクター」というのがCPUに組み込まれていて、負荷が高い処理はPコアに振り分けされるらしい。
実際、topでの挙動を見ると、mpdの処理は専ら「CPU0」と「CPU2」、2つのスレッドが代りばんこに受け持っているようだ。CPU0~3がPコアのスレッドなのかな。
これは、4つのスレッド全てでリレーする、820 G2のi5-5300Uの挙動とは異なる。
しかしそれなら、4GHz以上で動いてもいいと思うのだが、、、
ネット上を調べていたら、CPUの動作クロックを設定する「cpufreq」というツールがあり、Tiny Core 11では「cpupower.tcz」という形でリポジトリ上にあるらしいということが分かった。
インストール。
tc@box:~$ cpupower Usage: cpupower [-c|--cpu cpulist ][ ] Supported commands are: frequency-info frequency-set idle-info idle-set set info monitor help Not all commands can make use of the -c cpulist option. Use 'cpupower help ' for getting help for above commands. tc@box:~$ cpupower frequency-info analyzing CPU 0: driver: intel_pstate CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: Cannot determine or is not supported. hardware limits: 400 MHz - 4.70 GHz available cpufreq governors: performance powersave current policy: frequency should be within 400 MHz and 4.70 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 405 MHz (asserted by call to kernel) boost state support: Supported: yes Active: yes tc@box:~$ tc@box:~$ sudo cpupower frequency-set -g performance Setting cpu: 0 Setting cpu: 1 Setting cpu: 2 Setting cpu: 3 Setting cpu: 4 Setting cpu: 5 Setting cpu: 6 Setting cpu: 7 Setting cpu: 8 Setting cpu: 9 Setting cpu: 10 Setting cpu: 11 tc@box:~$ cpupower frequency-info analyzing CPU 0: driver: intel_pstate CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: Cannot determine or is not supported. hardware limits: 400 MHz - 4.70 GHz available cpufreq governors: performance powersave current policy: frequency should be within 400 MHz and 4.70 GHz. The governor "performance" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 657 MHz (asserted by call to kernel) boost state support: Supported: yes Active: yes tc@box:~$ tc@box:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance
「powersave」を「performance」に変更。
これで、CPUがパフォーマンス優先にセットされた。
これでどうかというと、やはり、3.7GHzまで。
どうしたものかな、と思いながら使っていたら、ときに3.7GHzより少し上が出る。コンスタントには出ない。しかし、どうやら出せないわけじゃないんだろうなと。
そこで、BIOS関係で節電に関する設定を調整してみることにした。
ネット上に公開されているHPのマニュアルから引用。
HP PC Commercial BIOS (UEFI) Setup
Administration Guide
For Commercial Platforms using HP BIOSphere Gen 7-9 2020 -2022
Runtime Power Management | When checked, enables the processor to run at lower frequencies (P-states) when higher performance is not needed. When unchecked, the processor always runs at maximum frequency. |
Extended Idle Power States | When checked, enables the processor to rest in lower power states (C-states) when idle. |
Power Control | When checked, enables the notebook to support power management applications such as IPM+ that help enterprises reduce power costs by intelligently managing the battery usage of the notebook. |
Battery Health Manager | Sets charging policy based on optimizing for battery life or for battery duration. The possible settings are: • Maximize my battery health • Let HP manage my battery charging |
しかし設定できる項目が少ない。こんなもんなのかなあ。
ネット上の日本語マニュアルは古いので英語の方を読む。日本語版には書いてないようなことが書いてある。
とりあえず、下記のように設定してみた。
Runtime Power Management | on → off |
Extended Idle Power States | on |
Power Control | on → off |
Battery Health Manager | Let HP → Maximize |
設定変えたら、ほとんど動いていなかったEコアたちが一斉に動きだし、音が途切れるように。
Pコアに重要な仕事を降るということをしなくなったようだ。
変更した設定を戻していく。
Power Controlを「on」に。
Pコアに仕事を降るようになった?ようだが、それでも音が途切れる。
tc@box:~$ cpupower frequency-info analyzing CPU 0: no or unknown cpufreq driver is active on this CPU CPUs which run at the same hardware frequency: Not Available CPUs which need to have their frequency coordinated by software: Not Available maximum transition latency: Cannot determine or is not supported. Not Available available cpufreq governors: Not Available Unable to determine current policy current CPU frequency: Unable to call hardware current CPU frequency: Unable to call to kernel boost state support: Supported: no Active: no tc@box:~$ tc@box:~$ grep MHz /proc/cpuinfo cpu MHz : 841.518 cpu MHz : 1462.869 cpu MHz : 1700.000 cpu MHz : 1703.346 cpu MHz : 634.992 cpu MHz : 1034.485 cpu MHz : 1013.223 cpu MHz : 1197.852 cpu MHz : 1119.194 cpu MHz : 977.032 cpu MHz : 1196.461 cpu MHz : 1198.542 tc@box:~$
なんか、すごく上手くいってないっぽい。IntelのCPUだという認識が出来ていない。
クロック周波数も上がっていない。
Runtime Power Managementを「on」に戻す。
Power Controlを「off」に。
これで、まともに音が出るようになった。
tc@box:~$ cpupower frequency-info analyzing CPU 0: driver: intel_pstate CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: Cannot determine or is not supported. hardware limits: 400 MHz - 4.70 GHz available cpufreq governors: performance powersave current policy: frequency should be within 400 MHz and 4.70 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 966 MHz (asserted by call to kernel) boost state support: Supported: yes Active: yes tc@box:~$ sudo cpupower frequency-set -g performance Setting cpu: 0 Setting cpu: 1 *snip* tc@box:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance tc@box:~$
これで700kHz台を出そうとしたが、やはり10秒ほどでぶちぶち途切れる。
300kHz台だと問題なく音が出る。
音が出ているときのCPUのクロック周波数の上限は3.7GHz付近で変わらない。
まともに音が出ていないときは、クロック周波数も上がっていない、ということがある。ここの辺り挙動が謎だ。
ちょっと気になったのが、BIOSの説明書に出てきた「IPM+」というもの。
電源管理を行うソフトらしい。
Windowsで起動したら設定できるらしいので、セキュリティブートを有効にしてWindowsを起動し確認してみたら、インストールされていないようだったので、ほっとくことにする。
結局、BIOSの電源関係はあまり関係ないように思われた。
もしかして、Tiny Core OSの問題?とも思ったりもするが、調べてもはっきりしないし、確信もない。
この件は、当面、保留である。
そういうわけで、HP Probook 450 G9 mpdサーバーは、libsamplerateの設定を「Best Sinc Interpolator」、アップサンプリング設定を384kHzで動かしている。
そこそこ余裕を持って動いているように見える。
というのは、topで見るとmpdを担当するCPU0、CPU2、2つのスレッドがともに休んでいる時間がそこそこ見えるからだ。
比較したら、820 G2でMedium、768kHzで動かす方がもっと余裕がある挙動で動く。
Bestの設定は、やはり相当、重いのだと思う。
音はそれに見合うものがあると思うのだけど、音質の確認は流し聴きだけで、十分にはしていない。
音源によってはリアリティがMedium、768kHzより高いと思う。
Medium、768kHzと、Best、192kHzだと、どっちがいいかは好みにもよるかも、みたいな感じだった。これらも真剣に比較しないまま今に至ってるんだけど、Best、384kHzは、それらの水準を超えると思う。
今後、余裕がある時に確認していこうと思う。
課題はいろいろ残っているけど、無理せず、焦らず、という感じ。
6月1日、追記。
なぜCPUのクロック周波数が3.7GHzまでしか上がらないのか。
結論からいうと、Tiny Core OSが原因だった。
TC64-11.1のカーネルは5.4.3。これが古かったのだ。
TC64-14のカーネルは6.1.2。「corepure64」と「vmlinuz64」をコピー&ペーストで入れ替え、mpdサーバーのOSをバージョンアップしてみた。こういうやり方はソフトが上手く動く保証がないけど、簡単に出来る。動けば恩の字だ。
mpdはちゃんと動いた。
CPUも、4.7GHzで機能した。新しいCPUだから新しいカーネルが必要だったのだろう。
しかしlibsamplerate、Bestの設定を使った700kHz台へのアップサンプリングは、音が途切れて無理だった。
実際、300kHz台で鳴らした時点で、なんとなく予想はしていた。3.7GHzでなんとかなるレベルだから、700kHz台で動かすなら最低でも5GHz以上が必要じゃないかと思った。それでも無理かもしれない。
今回のOSのバージョンアップで問題だったのは、sshが使えなくなったことだ。mpdサーバー本体のキーボードから操作せざるを得なくて少し面倒だった。しかし、そう複雑なことはしてないので出来たという感じ。
sshが使えるようだったらサーバーを入れ替えたかもしれない。今回はそうはせず今までのまま、TC64-11.1で運用継続だ。入れ替えは暇が出来たらということになる。
6月4日、追記。
sshは、openssh.tczをTC14のリポジトリから再インストールしたらつながるようになった。
そういうわけで、めでたくサーバーは入れ替えた。今のところ、問題ないように見える。CPUも4.7GHz近くで動いている。