久しぶりの録画サーバのトラブルだったので、記録します。
事象
録画サーバで録画ができなくなりました。気づいたのは2024年2月12日17:00頃です。tsファイルは作成されているのに、mp4へのエンコードができていませんでした。
AIの処理でビデオカードを酷使すると、たまにエンコードできなくなることがあったので、それかと思いました。ただ、ffmepegを使用してハードエンコードしようとしても、エンコードできません。
これは後でわかったのですが、調べると2024年2月11日(日)10:33から録画ができなくなってました。なぜこれがわかったかというと、ワイドナショーを録画していて、10:33に録画が終了していたからです。
暫定対応
過去の経験に照らし合わせ、ちゃんと事象を確認しなかったことが原因で対応には不手際がありました。不手際含めて、書きます。
ビデオカードのドライバが合わなくなったのだと勘違いして、古いドライバーを入れ直してみました。これが間違いのもとです。
ドライバーを入れ直して、nvidia-smi
すると、、、。最新のドライバーが入っているか確認して出力されます。
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
ここで初めて、EPGStationやMirakurunをリスタートします。
Mirakurunが起動しないのです。“/dev/pxmlt8video0”
が無いと表示されます。ここで、「ビデオカードではないかもしれない」と思いました。
docker-compose restart [+] Running 2/3 : Container epgstation-nvenc Started 1.3s ⠸ Container mirakurun Restarting 1.3s : Container mysql-epgstation-v2 Started 1.0s Error response from daemon: Cannot restart container 1a585806d4f9f6b8f41f6611da3816c276ab94fd462369ae36d00183b002900b: error gathering device information while adding custom device “/dev/pxmlt8video0”: no such file or directory
以下にある手順どおりにコンパイルしなおそうとしましたが、コンパイルエラーになります。
原因
同じ事象に陥っている方が記録を残していてくださいました。先人に感謝。
カーネルのバージョンを確認してみます。6.5.0-17-generic
というバージョンでした。カーネルの6.4以降と6.3以降で呼び出し処理が変わっているようです。
uname -a Linux ubuntu2204 6.5.0-17-generic #17~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 16 14:32:32 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
ということで、カーネルを以前のバージョンに戻します。6.2.0-34
なら戻せそうです。
参考にしたのはこの記事です。Ubuntu でアップデートで問題の発生したカーネルを旧カーネルに戻す #Ubuntu - Qiita
$ sudo grep menuentry /boot/grub/grub.cfg if [ x”${feature_menuentry_id}” = xy ]; then menuentry_id_option=“--id” menuentry_id_option=“” export menuentry_id_option menuentry ‘Ubuntu’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-simple-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { submenu ‘Advanced options for Ubuntu’ $menuentry_id_option ‘gnulinux-advanced-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘Ubuntu, with Linux 6.5.0-17-generic’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-6.5.0-17-generic-advanced-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘Ubuntu, with Linux 6.5.0-17-generic (recovery mode)’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-6.5.0-17-generic-recovery-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘Ubuntu, with Linux 6.2.0-34-generic’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-6.2.0-34-generic-advanced-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘Ubuntu, with Linux 6.2.0-34-generic (recovery mode)’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-6.2.0-34-generic-recovery-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘Ubuntu, with Linux 6.1.0-1033-oem’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-6.1.0-1033-oem-advanced-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘Ubuntu, with Linux 6.1.0-1033-oem (recovery mode)’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-6.1.0-1033-oem-recovery-e22ba33b-9cc9-4a8f-b320-fa9fccc68f55’ { menuentry ‘UEFI Firmware Settings’ $menuentry_id_option ‘uefi-firmware’ {
sudo vim /etc/default/grub
で以下を設定します。
GRUB_DEFAULT=“1>2”
grubをアップデートします。
sudo update-grub Sourcing file `/etc/default/grub’ Sourcing file `/etc/default/grub.d/init-select.cfg’ Generating grub configuration file ... Found linux image: /boot/vmlinuz-6.5.0-17-generic Found initrd image: /boot/initrd.img-6.5.0-17-generic Found linux image: /boot/vmlinuz-6.2.0-34-generic Found initrd image: /boot/initrd.img-6.2.0-34-generic Found linux image: /boot/vmlinuz-6.1.0-1033-oem Found initrd image: /boot/initrd.img-6.1.0-1033-oem Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings ... done
戻っているか確認します。6.2.0-34-generic
に戻ってました。
uname -a Linux ubuntu2204 6.2.0-34-generic #34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 13:12:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
追加
ビデオカードのドライバが戻っていないので、以下のように使えません。
nvidia-smi NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
そのため、ドライバ単体ではなく、CUDA含めて再度インストールしました。
ビデオカードの戻しが1時間ぐらいかかりました。。。涙。
なんとか動くようになりました。
なお、EPGStationの録画済み表示は以下のように録画できなかった番組はサムネイルが表示されていません。