MySQLでERROR! The server quit without updating PID fileの対処法(MAC)

MySQLのバージョンを新しくし、

mysql.server start

で起動しようとしても

ERROR! The server quit without updating PID file (/usr/local/var/mysql/****.local.pid).

というエラーが出てしまう。

****.local.pidファイルを作成してもだめだった。

 

ようやく原因がわかった。

以前からMySQLは起動しており、それを止める必要があったのだ。

システム環境設定からMySQLをクリックする。

 

Stop MySQL Serverをクリックすると前から動いていたものが止まる。

そして新しいバージョンで起動できる様になる!

mysql.server start

$ sudo mysql

 

 

GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation. のエラー対処

GeForce RTX 3090がある新しいマシンでは以下のようなエラーが報告されている。

GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.

The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.

If you want to use the GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

 

これはCUDA11.1でないから出るエラーのようだ。

なのでこちらからCUDA11.1のものを選び、

https://pytorch.org/get-started/previous-versions/

pip, condaでpytorchなどをインストールすれば上手くいく。

 

以下を参照

https://discuss.pytorch.org/t/geforce-rtx-3090-with-cuda-capability-sm-86-is-not-compatible-with-the-current-pytorch-installation/123499/7

Ubuntuにdockerをインストールする方法

Ubuntuにdockerをインストールする際は以下のサイトの手順に従うのが一番良い。

https://www.softek.co.jp/SID/support/sidfmvm/guide/install-docker-ubuntu1804.html

 

サイトが消えてしまうと困るので一応こちらにもコマンドだけ書いておく。

 

Dockerのリポジトリを設定

$ sudo apt update

 

$ sudo apt install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

 

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

 

$ sudo apt-key fingerprint 0EBFCD88

(fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88であることを確認)

 

$ sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable"

 

Dockerをインストールする

 

$ sudo apt update

 

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

 

※以下はやらなくても良い?

Dockerにプロキシ設定をする

 

$ sudo mkdir -p /etc/systemd/system/docker.service.d

 

$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf

 

$ sudo systemctl daemon-reload

 

$ sudo systemctl restart docker

 

$ systemctl show --property=Environment docker

 

以下が動いたら完成!

$ sudo docker run --rm hello-world

 

ただし毎回sudoとうつのは面倒だ。

なので今のユーザーをdocker groupに加える。

$ sudo groupadd docker
$ sudo usermod -aG docker $USER

$ reboot

でリブートするとsudoがいらなくなっているはず

 

 

mp4からyuvに変換する方法

mp4動画からffmpegを用いてyuv動画に変換する方法を示す。

以下の記事を参考にした。

https://stackoverflow.com/questions/45972119/how-to-convert-mp4-to-yuv-file-using-ffmpeg

 

$ ffmpeg -i sample.mp4 out.yuv

 

実際に動画を確認すると、ちゃんと変換されていた。

 

 

 

Fraunhofer Versatile Video Encoder (VVdeC)の実行について (vvdecapp: command not foundの対処法)

以前VVenCについて書いたが、今回はVVdeCについて書く。

2021/11/2現在ではまだコードが開発中であり、問題点もまだあるようだ。

 

インストール方法を書く。

$ git clone https://github.com/fraunhoferhhi/vvdec

をした後にビルドを行うのだが、方法がいくつか提供されている。

自分は"Build using plain make"の方法をオススメする。

("Building usin cmake"では作成されなかったファイルなどもあったため)

 

ただvvdecappもまた

$ vvdecapp -b str.266 -o raw_yuv.yuv

のように実行しようとしても上手く行かないという問題があった。

 

実行は以下のようにやると上手くいく

$ vvdec/bin/release-static/vvdecapp -b str.266 -o raw_yuv.yuv

 

つまりまたbin/release-static内にあるvvdecappまでパスを書いて実行すると上手くいく。

 

 

Fraunhofer Versatile Video Encoder (VVenC)の実行について (vvencFFapp: command not foundの対処法)

FraunhoferのVersatile Video Encoder (VVenC)の実行方法について記述する。

VVenCについては以下に書かれている。

https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc/fraunhofer-versatile-video-encoder-vvenc.html

 

また、コードはgithubに公開されている。

https://github.com/fraunhoferhhi/vvenc

 

インストール方法はgithubに書かれていているが、cmakeのバージョンが大切になってくる。

(指定のバージョンより前のものを利用するとビルドできなかった)

また、cmakeのインストール方法については以下に書いてある。

https://jskangaroo.hatenablog.com/entry/2020/02/11/213905

 

そしてgithubにあるように

vvencFFapp --preset medium --InputFile video.yuv -s 416x240 -fr 30 --QP 37 -b aaa.out

 

のように実行してみると、

bash: vvencFFapp: command not found

と出力され、実行ができない。

 

以下に解決方法を書く。

vvenc内のinstall/bin/にあるvvencappやvvencFFappまでのパスを書く必要があった。

~/vvenc/install/bin/vvencFFapp --preset medium --InputFile video.yuv -s 416x240 -fr 30 --QP 37 -b aaa.out

 

あるいはパスを通すこともできるはずだが、今回はここまで。

 

nvidia-smiでGPU情報が出力されなくなったときの対処法

$ 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.

というエラーが出てしまった。

そんなときの解決方法を記述する。

初めは以下のサイトを参考にした。

https://blog.hysakhr.com/2019/11/12/エラーメッセージ「nvidia-smi-has-failed-because-it-couldnt-communicate-with-the-nvidia-driver-make-sure-that-the-latest-nvidia-driver/

まずはnvidiaなどの既存のドライバをアンインストール、再インストールする。

$ sudo apt-get --purge remove nvidia-*

$ sudo apt-get --purge remove cuda-*

($ ubuntu-drivers devices)

$ sudo ubuntu-drivers autoinstall

$ sudo reboot

$ nvidia-smi

この時点で出力された (参考にしたサイトではまだだった)

$ nvcc -V
も出力された

ここで$ docker run --gpus all ~

などとdockerコンテナを作ろうとすると

docker: Error response from daemon: could not select device driver "" with capabilities: gpu.

ERRO[0002] error waiting for container: context canceled 

というエラーが出た。

ここからは別のの記事

https://jskangaroo.hatenablog.com/entry/2021/08/17/150002?_ga=2.194437485.1788482488.1634360320-1604003932.1632965513

を参照して解決。

一応内容を書いておくと

$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

 

$ curl -s -L https://nvidia.github.io/nvidia-container-runtime/experimental/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list

 

$ sudo apt-get update

 

$ sudo apt-get install -y nvidia-docker2

 

$ sudo systemctl restart docker

 

$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

 

$ nvidia-smiの出力があれば、上手くいっている。