見出し画像

WSL2で4K4Dを試してみる...も

とある界隈で話題の4K4D「Real-Time 4D View Synthesis at 4K Resolution」です。3ヶ月の時を経て、GitHubにソースが公開されましたので、動くかどうか分かりませんが、試してみます。


12/24 23:00(JST)追記。
WSL2だとPyOpenGLがうまく動かないため、Windows上で試してみることにしました。こちらですとPyOpenGLが駄駄をこねることなく動いています。その試してみた記事がこちらです。 


12/23 13:00(JST)追記。
commitされたスクリプトファイルを試してみたので追記しています。
が、最後のレンダリング処理でエラーが発生したため、なんでだ?と調べているところです。

12/22 14:45(JST)追記。
miuさんからのissue登録により、スクリプトファイルが追加いただけました。こちらで現在その先を試しているところです。
ですので、この記事の内容は、12/22 1:00(JST)頃時点のものになる点、ご留意ください。



準備

python関連

python3 -m venv 4k4d
cd $_
source bin/activate

git clone しましょう。

git clone https://github.com/zju3dv/4K4D.git
cd 4K4D

続いてパッケージのインストール…なのですが、事前にいろいろ設定しておかないと失敗します。

注意する点としては、

  • CUDA Toolkitは12.1以上じゃないと、tinycudannパッケージのビルドに失敗する

  • 環境変数は適切に設定しておく

です。

CUDA Toolkitのアップデート

WSL2向けの12.3を

手順に従いインストールしました。

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.3.1/local_installers/cuda-repo-wsl-ubuntu-12-3-local_12.3.1-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-12-3-local_12.3.1-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-12-3-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-3

環境変数の設定

以下の3つきちんと設定しておきましょう。

export PATH="/usr/local/cuda/bin:${PATH}"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64"
export LDFLAGS=-L/usr/lib/wsl/lib
  • PATH: nvcc コマンドを実行できるように。

  • LD_LIBRARY_PATH: CUDA Toolkit(12.3)のライブラリをリンクするために。

  • LDFLAGS: libcuda.soをリンク(-lcuda)するために。

pip install & list

やっとこさ、pip installです。requirements.txtの内容を確認すると、

$ cat requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | wc -l
72
$

72パッケージのインストール、そしていくつかのパッケージはgit cloneしてコンパイルとなるため、結構なお時間を消費します。
上手くいけば1時間足らずで終わります。

pip install torch wheel
cat requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install
pip install -e . --no-build-isolation --no-deps

 pip listコマンドの結果は以下です。長い。。。

$ pip list
Package                   Version            Editable project location
------------------------- ------------------ --------------------------------------------
absl-py                   2.0.0
addict                    2.4.0
aiohttp                   3.9.1
aiosignal                 1.3.1
ansi2html                 1.9.1
antlr4-python3-runtime    4.9.3
anyio                     4.2.0
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-lru                 2.0.4
async-timeout             4.0.3
attrs                     23.1.0
autopep8                  2.0.4
Babel                     2.14.0
beautifulsoup4            4.12.2
black                     23.12.0
bleach                    6.1.0
blessed                   1.20.0
blinker                   1.7.0
cachetools                5.3.2
calmsize                  0.1.3
certifi                   2023.11.17
cffi                      1.16.0
charset-normalizer        3.3.2
chumpy                    0.70
clang-format              17.0.6
click                     8.1.7
cloudpickle               3.0.0
comm                      0.2.0
commentjson               0.9.0
ConfigArgParse            1.7
contourpy                 1.2.0
cuda-python               12.3.0
cycler                    0.12.1
dash                      2.14.2
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-table                5.0.0
debugpy                   1.8.0
decorator                 5.1.1
defusedxml                0.7.1
detectron2                0.6
diff-gauss                1.0.5
docstring-parser          0.15
dotmap                    1.3.30
einops                    0.7.0
et-xmlfile                1.1.0
exceptiongroup            1.2.0
executing                 2.0.1
fast-autocomplete         0.9.0
fastjsonschema            2.19.0
filelock                  3.13.1
Flask                     3.0.0
flatbuffers               23.5.26
fonttools                 4.47.0
fqdn                      1.5.1
frozenlist                1.4.1
fsspec                    2023.12.2
func-timeout              4.3.5
fvcore                    0.1.5.post20221221
gdown                     4.7.1
glfw                      2.6.4
google-auth               2.25.2
google-auth-oauthlib      1.2.0
gpustat                   1.2.dev19+gf4cd639
grpcio                    1.60.0
h5py                      3.10.0
human-body-prior          2.2.2.0
hydra-core                1.3.2
idna                      3.6
imageio                   2.33.1
imgui-bundle              1.1.0
importlib-metadata        7.0.0
iopath                    0.1.9
ipdb                      0.13.13
ipykernel                 6.27.1
ipython                   8.18.1
ipywidgets                8.1.1
isoduration               20.11.0
itsdangerous              2.1.2
jedi                      0.19.1
Jinja2                    3.1.2
joblib                    1.3.2
json5                     0.9.14
jsonpointer               2.4
jsonschema                4.20.0
jsonschema-specifications 2023.11.2
jupyter                   1.0.0
jupyter_client            8.6.0
jupyter-console           6.6.3
jupyter_core              5.5.1
jupyter-events            0.9.0
jupyter-lsp               2.2.1
jupyter_server            2.12.1
jupyter_server_terminals  0.5.0
jupyterlab                4.0.9
jupyterlab_pygments       0.3.0
jupyterlab_server         2.25.2
jupyterlab-widgets        3.0.9
kiwisolver                1.4.5
kornia                    0.7.0
lark-parser               0.7.8
lazy_loader               0.3
lpips                     0.1.4
Markdown                  3.5.1
markdown-it-py            3.0.0
MarkupSafe                2.1.3
matplotlib                3.8.2
matplotlib-inline         0.1.6
mdurl                     0.1.2
mediapipe                 0.10.9
memory-tempfile           2.2.3
mistune                   3.0.2
mpmath                    1.3.0
msgpack                   1.0.7
multidict                 6.0.4
munch                     4.0.0
mypy-extensions           1.0.0
nbclient                  0.9.0
nbconvert                 7.13.0
nbformat                  5.7.0
nest-asyncio              1.5.8
networkx                  3.2.1
ninja                     1.11.1.1
notebook                  7.0.6
notebook_shim             0.2.3
numpy                     1.26.2
nvdiffrast                0.3.1
nvidia-cublas-cu12        12.1.3.1
nvidia-cuda-cupti-cu12    12.1.105
nvidia-cuda-nvrtc-cu12    12.1.105
nvidia-cuda-runtime-cu12  12.1.105
nvidia-cudnn-cu12         8.9.2.26
nvidia-cufft-cu12         11.0.2.54
nvidia-curand-cu12        10.3.2.106
nvidia-cusolver-cu12      11.4.5.107
nvidia-cusparse-cu12      12.1.0.106
nvidia-ml-py              12.535.133
nvidia-nccl-cu12          2.18.1
nvidia-nvjitlink-cu12     12.3.101
nvidia-nvtx-cu12          12.1.105
oauthlib                  3.2.2
omegaconf                 2.3.0
open3d                    0.17.0
opencv-contrib-python     4.8.1.78
opencv-python             4.8.1.78
openpyxl                  3.1.2
overrides                 7.4.0
packaging                 23.2
pandas                    2.1.4
pandocfilters             1.5.0
parso                     0.8.3
pathspec                  0.12.1
pdbr                      0.8.8
pexpect                   4.9.0
Pillow                    10.1.0
pip                       22.0.2
platformdirs              4.1.0
plotly                    5.18.0
plyfile                   1.0.2
portalocker               2.8.2
prometheus-client         0.19.0
prompt-toolkit            3.0.43
protobuf                  3.20.3
psutil                    5.9.7
ptyprocess                0.7.0
pure-eval                 0.2.2
pyasn1                    0.5.1
pyasn1-modules            0.3.0
pycocotools               2.0.7
pycodestyle               2.11.1
pycparser                 2.21
PyGLM                     2.7.1
Pygments                  2.17.2
PyMCubes                  0.1.4
pymeshlab                 2023.12
pyntcloud                 0.3.1
PyOpenGL                  3.1.7
pyparsing                 3.1.1
pyperclip                 1.8.2
pyquaternion              0.9.9
PySocks                   1.7.1
python-dateutil           2.8.2
python-json-logger        2.0.7
pytorch-memlab            0.3.0
pytorch-msssim            1.0.0
pytorch3d                 0.7.5
PyTurboJPEG               1.7.3
pytz                      2023.3.post1
PyYAML                    6.0.1
pyzmq                     25.1.2
qtconsole                 5.5.1
QtPy                      2.4.1
referencing               0.32.0
requests                  2.31.0
requests-oauthlib         1.3.1
retrying                  1.3.4
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rich                      13.7.0
rpds-py                   0.15.2
rsa                       4.9
ruamel.yaml               0.18.5
ruamel.yaml.clib          0.2.8
scikit-image              0.22.0
scikit-learn              1.3.2
scipy                     1.11.4
Send2Trash                1.8.2
setuptools                59.6.0
shtab                     1.6.5
simple-knn                0.0.0
six                       1.16.0
smplx                     0.1.28
sniffio                   1.3.0
sounddevice               0.4.6
soupsieve                 2.5
stack-data                0.6.3
sympy                     1.12
tabulate                  0.9.0
tenacity                  8.2.3
tensorboard               2.15.1
tensorboard-data-server   0.7.2
tensorboardX              2.6.2.2
termcolor                 2.4.0
terminado                 0.18.0
threadpoolctl             3.2.0
tifffile                  2023.12.9
timg                      1.1.6
tinycss2                  1.2.1
tinycudann                1.7
tomli                     2.0.1
torch                     2.1.2
torch-scatter             2.1.2
torch-tb-profiler         0.4.3
torchdiffeq               0.2.3
torchmcubes               0.1.0
tornado                   6.4
tqdm                      4.66.1
traitlets                 5.14.0
trimesh                   4.0.7
triton                    2.1.0
types-python-dateutil     2.8.19.14
typing_extensions         4.9.0
tyro                      0.6.0
tzdata                    2023.3
ujson                     5.9.0
UNKNOWN                   0.0.0              /path/to/venv/4k4d/4K4D
uri-template              1.3.0
urllib3                   2.1.0
wcwidth                   0.2.12
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.7.0
Werkzeug                  3.0.1
wheel                     0.42.0
widgetsnbextension        4.0.9
xatlas                    0.0.8
yacs                      0.1.8
yapf                      0.40.2
yarl                      1.9.4
zipp                      3.17.0

インストール結果の確認

パッケージが正しくインストールできたかを確認しましょう。以下のようにエラーが出力されていなければ、(おそらく)OKです。

$ python -c "from easyvolcap.utils.console_utils import *"
$ python -c "import torch; print(torch.rand(3,3,device='cuda'))"
tensor([[0.3733, 0.9015, 0.0957],
        [0.2875, 0.4670, 0.5491],
        [0.1503, 0.7390, 0.0099]], device='cuda:0')
$ python -c "from pytorch3d.io import load_ply"
$ python -c "import tinycudann"
$ python -c "import open3d"
$

モデルなどのダウンロード

事前学習モデルのダウンロード

Google Driveさんからダウンロードです。gdownパッケージを使いましょう。

pip install gdown

してからの、

mkdir data
gdown -O data --folder --remaining-ok https://drive.google.com/drive/folders/1mBMsYeXawU_sF3NFyuWC1hnfrYbSfDfi?usp=sharing

でダウンロードされます。50ファイルを超えるので、--remaining-okオプションを付けないとダウンロードできません。

かなりの量なので、なかなかダウンロードが終わりません。私の環境では、30分程度かかりました。

追記:12/23 - ここから - 
Google Driveのアクセス制限?に引っかかったのかすべての事前学習モデルのダウンロードができていませんでした。試してみたいモデルだけをダウンロードするようにしないとダメかも…。
- ここまで -

最小限データセットのダウンロード

試してみる、ですので、データセットは最小限に…。

gdown -O data --folder --remaining-ok https://drive.google.com/drive/folders/1pH-SWwbt01raqZ74dvcOvYFxDbGGUcxu?usp=sharing

最小限データセットのtarball展開

適切にtar.gzファイルを展開しなさいとreadme.mdに書いています。
以下のようなお手製のshell scriptをささっと書いて、展開です。

FILE_SUFFIX="_libx265.tar.gz"

TARBALLS=$(find data -type f -name '*.tar.gz')
for tb in ${TARBALLS}; do
    OUTDIR=$(dirname ${tb})/$(basename ${tb} ${FILE_SUFFIX})
    mkdir -p ${OUTDIR}
    tar zxvf ${tb} -C ${OUTDIR}
done

試してみよう

ファイルが見当たらない…

続いて、「2つのスクリプトを使って最小限データセットを処理する」らしい。よし、それらを実行しようではないか!

なのだが、この.pyファイルが…ない!

https://github.com/zju3dv/4K4D/blob/main/scripts/realtime4dv/extract_images.py

こっちもない! 2つともない!

https://github.com/zju3dv/4K4D/blob/main/scripts/realtime4dv/extract_masks.py

来年には動くようになっているかしら…。

再び試してみよう: 12/23追記。

無事、ファイルがcommitされたのでためしますよー。

extract_images.pyを実行した際、torchvisionパッケージがないとエラーになってしまったので先にinstallしておきます。

$ pip install torchvision
$ pip list | grep torchvision
torchvision               0.16.2
$

extract_images.pyの実行

引数data_rootに指定したディレクトリ(これだとrenbody/0013_01)に格納されている動画から画像データを抽出するというコマンドのようです。

python scripts/realtime4dv/extract_images.py --data_root data/renbody/0013_01

入力データの動画は60ファイルありました。1ファイル約1MB。

$ find data/renbody/0013_01 -type f -name '*.mp4'
data/renbody/0013_01/videos_libx265/19_N150_x293_y144_W1024_H1224_FW2048_FH2448.mp4
(snip)
data/renbody/0013_01/videos_libx265/58_N150_x590_y414_W1500_H2048_FW3000_FH4096.mp4
$ find data/renbody/0013_01 -type f -name '*.mp4' | wc -l
60
$

このextact_images.pyを実行すると、pngファイルがたくさんできます。9000ファイル…。

$ find data/renbody/0013_01/images_libx265 -type f -name '*.png' | head
data/renbody/0013_01/images_libx265/17/000023.png
data/renbody/0013_01/images_libx265/17/000094.png
data/renbody/0013_01/images_libx265/17/000141.png
data/renbody/0013_01/images_libx265/17/000042.png
data/renbody/0013_01/images_libx265/17/000049.png
data/renbody/0013_01/images_libx265/17/000014.png
data/renbody/0013_01/images_libx265/17/000052.png
data/renbody/0013_01/images_libx265/17/000045.png
data/renbody/0013_01/images_libx265/17/000018.png
data/renbody/0013_01/images_libx265/17/000073.png
$ find data/renbody/0013_01/images_libx265 -type f -name '*.png'  | wc -l
9000
$

抽出された画像をいくつか確認しましたがちゃんと出力されていました。以下はその中の一つの画像。

data/renbody/0013_01/images_libx265/00/000001.png

extract_masks.pyの実行

つづいて、マスクの抽出。

python scripts/realtime4dv/extract_masks.py --data_root data/renbody/0013_01

こちらも動画を入力にして、pngファイルを生成しています。こちらも9000ファイル作られました。

$ find data/renbody/0013_01/masks_libx265 -type f -name '*.png' | head
data/renbody/0013_01/masks_libx265/17/000023.png
data/renbody/0013_01/masks_libx265/17/000094.png
data/renbody/0013_01/masks_libx265/17/000141.png
data/renbody/0013_01/masks_libx265/17/000042.png
data/renbody/0013_01/masks_libx265/17/000049.png
data/renbody/0013_01/masks_libx265/17/000014.png
data/renbody/0013_01/masks_libx265/17/000052.png
data/renbody/0013_01/masks_libx265/17/000045.png
data/renbody/0013_01/masks_libx265/17/000018.png
data/renbody/0013_01/masks_libx265/17/000073.png
$ find data/renbody/0013_01/masks_libx265 -type f -name '*.png' | wc -l
9000
$

先ほど確認した抽出画像に対応するマスク画像がこちら。

data/renbody/0013_01/masks_libx265/00/000001.png

とてもいい感じに。ちゃんと動いているようです。

レンダリングする…も

やっとレンダリングです。
readme.md を見ると evc というコマンドを実行となっています。

evc -t gui -c configs/projects/realtime4dv/rendering/4k4d_0013_01.yaml,configs/specs/video.yaml

https://github.com/zju3dv/4K4D/blob/main/pyproject.toml
をみると、

[project.scripts]
evc = "easyvolcap.scripts.main:main_entrypoint"
evc-test = "easyvolcap.scripts.main:test_entrypoint"
evc-train = "easyvolcap.scripts.main:train_entrypoint"

evc-gui = "easyvolcap.scripts.wrap:gui_entrypoint"
evc-dist = "easyvolcap.scripts.wrap:dist_entrypoint"
evc-prof = "easyvolcap.scripts.wrap:prof_entrypoint"

とあるので、easyvolcap/scripts/main.pyを実行するように読み替えて実行です。

python easyvolcap/scripts/main.py -t gui -c configs/projects/realtime4dv/rendering/4k4d_0013_01.yaml,configs/specs/video.yaml

いい感じに動き始めました。

easyvolcap/scripts/main.py実行中

(補足)最初、この付近でOOM Killerが発動されpythonプロセスが落ちてしまいました。このため、WSL2で使用できるOSメモリ割当を以下のように拡張しています。

$ cat /mnt/c/Users/WhoAmI/.wslconfig
[wsl2]
memory=48GB
swap=32GB
$

ロードまでできた、これでイケると思ったら、「有効なコンテキストがないのでエラー」という悲しきメッセージが…。

2023-12-23 11:52:23.674212 __main__ -> preflight: Starting experiment: 4k4d_0013_01, command: gui                                                                                                                                                                                                                 main.py:80
2023-12-23 11:53:03.840284 easyvolcap.utils.data_utils -> load_resize_undist_ims_bytes: Loading mask bytes for data/renbody/0013_01/masks_libx265 VAL 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9,000/9,000  0:00:39 < 0:00:00 188.6 it/s                                                           parallel_utils.py:68
2023-12-23 11:54:59.313473 easyvolcap.utils.data_utils -> load_resize_undist_ims_bytes: Loading imgs bytes for data/renbody/0013_01/images_libx265 VAL 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9,000/9,000  0:01:55 < 0:00:00 42.69 it/s                                                          parallel_utils.py:68
2023-12-23 11:55:47.115716 easyvolcap.utils.data_utils -> decode_crop_fill_ims_bytes: Cropping msks imgs for data/renbody/0013_01 VAL 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9,000/9,000  0:00:47 < 0:00:00 182.4 it/s                                                                           parallel_utils.py:68
2023-12-23 11:55:49.534366 easyvolcap.runners.visualizers.volumetric_video_visualizer -> __init__: Visualization output: data/result/4k4d_0013_01/{RENDER,DEPTH}                                                                                                                           volumetric_video_visualizer.py:76
2023-12-23 11:55:49.537732 easyvolcap.runners.recorders -> __init__: Saved config file to data/record/4k4d_0013_01/4k4d_0013_01_1703300149.yaml                                                                                                                                                             recorders.py:105
2023-12-23 12:01:28.609309 easyvolcap.models.samplers.super_charged_r4dv -> _load_state_dict_post_hook: Caching rgbw and center 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150/150  0:05:37 < 0:00:00 0.484 it/s                                                                                super_charged_r4dv.py:374
2023-12-23 12:01:29.167230 easyvolcap.models.samplers.super_charged_r4dv -> _load_state_dict_post_hook: Computing features for caching 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150/150  0:00:00 < 0:00:00 239.3 it/s                                                                         super_charged_r4dv.py:383
2023-12-23 12:01:42.920203 easyvolcap.models.samplers.super_charged_r4dv -> _load_state_dict_post_hook: Caching spherical harmonics 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150/150  0:00:13 < 0:00:00 10.94 it/s                                                                            super_charged_r4dv.py:390
2023-12-23 12:01:43.046839 easyvolcap.models.samplers.super_charged_r4dv -> precompute_geometry: Caching radius and alpha 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150/150  0:00:00 < 0:00:00 1,464 it/s                                                                                      super_charged_r4dv.py:416
2023-12-23 12:01:43.161323 easyvolcap.utils.net_utils -> load_network: Loaded network data/trained_model/4k4d_0013_01/1599.npz at epoch -1                                                                                                                                                                 net_utils.py:2658
2023-12-23 12:01:47.421345 easyvolcap.utils.console_utils -> inner: Runtime exception: Attempt to retrieve context when no valid context                                                                                                                                                                console_utils.py:337
╭─────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────╮
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/utils/console_utils.py:334 in inner                                              │
│                                                                                                                                          │
│ ❱ 334 │   │   │   return func(*args, **kwargs)                                                                                           │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/engine/registry.py:56 in inner                                                   │
│                                                                                                                                          │
│ ❱  56 │   │   return call_from_cfg(func, cfg)                                                                                            │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/engine/registry.py:47 in call_from_cfg                                           │
│                                                                                                                                          │
│ ❱  47return func(**call_args)                                                                                                       │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/scripts/main.py:119 in gui                                                       │
│                                                                                                                                          │
│ ❱ 119viewer: "VolumetricVideoViewer" = RUNNERS.build(viewer_cfg, runner=runner)  # will start the window                            │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/engine/registry.py:300 in build                                                  │
│                                                                                                                                          │
│ ❱ 300 │   │   return self.build_func(*args, **kwargs, registry=self)                                                                     │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/engine/registry.py:131 in build_from_cfg                                         │
│                                                                                                                                          │
│ ❱ 131return call_from_cfg(obj_cls, args)                                                                                            │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/engine/registry.py:47 in call_from_cfg                                           │
│                                                                                                                                          │
│ ❱  47return func(**call_args)                                                                                                       │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/runners/volumetric_video_viewer.py:123 in __init__                               │
│                                                                                                                                          │
│ ❱  123 │   │   self.init_texture()                                                                                                       │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/runners/volumetric_video_viewer.py:1243 in init_texture                          │
│                                                                                                                                          │
│ ❱ 1243 │   │   self.quad = Quad(H=self.H, W=self.W, compose=self.compose, compose_power=self.compose_power)  # will blit this texture to │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/utils/gl_utils.py:432 in __init__                                                │
│                                                                                                                                          │
│ ❱  432 │   │   self.update_gl_buffers()                                                                                                  │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/utils/gl_utils.py:368 in update_gl_buffers                                       │
│                                                                                                                                          │
│ ❱  368 │   │   self.resize_buffers(len(self.verts) if hasattr(self, 'verts') else 0,                                                     │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/utils/gl_utils.py:382 in resize_buffers                                          │
│                                                                                                                                          │
│ ❱  382 │   │   │   self.init_gl_buffers(v, f)                                                                                            │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/4K4D/easyvolcap/utils/gl_utils.py:405 in init_gl_buffers                                         │
│                                                                                                                                          │
│ ❱  405 │   │   │   gl.glVertexAttribPointer(i, s, t, gl.GL_FALSE, self.vert_size * self.verts.element_size(), ctypes.c_void_p(cumsum * s │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/lib/python3.10/site-packages/OpenGL/latebind.py:63 in __call__                                   │
│                                                                                                                                          │
│ ❱ 63 │   │   │   return self.wrapperFunction( self.baseFunction, *args, **named )                                                        │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/lib/python3.10/site-packages/OpenGL/GL/VERSION/GL_2_0.py:469 in glVertexAttribPointer            │
│                                                                                                                                          │
│ ❱ 469 │   contextdata.setValue( key, array )                                                                                             │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/lib/python3.10/site-packages/OpenGL/contextdata.py:58 in setValue                                │
│                                                                                                                                          │
│ ❱  58 │   context = getContext( context )                                                                                                │
│                                                                                                                                          │
│ /path/to/to/to/to/to/to/to/to/venv/4k4d/lib/python3.10/site-packages/OpenGL/contextdata.py:40 in getContext                              │
│                                                                                                                                          │
│ ❱  40 │   │   │   raise error.Error(                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Error: Attempt to retrieve context when no valid context
*** Attempt to retrieve context when no valid context
> /path/to/to/to/to/to/to/to/to/venv/4k4d/lib/python3.10/site-packages/OpenGL/contextdata.py(40)getContext()
     38         if context == 0:
     39             from OpenGL import error
---> 40             raise error.Error(
     41                 """Attempt to retrieve context when no valid context"""
     42             )

エラーなので、EasyVolcapのウインドウが立ち上がるも、真っ黒・・・。

EasyVolcapの黒い窓。

調べるか…。

参考

easyvolcap/scripts/main.py実行中のリソース

GPUもメモリもガンガン使用してます。GPUは、40GBないと厳しいかも。

タスクマネージャーのパフォーマンス

OSメモリ

topコマンドでみると、pythonコマンドで87.2%、41GB使用中…。

$ top -b -o +%MEM
top - 12:09:20 up  1:15,  1 user,  load average: 0.05, 1.34, 2.86
Tasks:  43 total,   1 running,  42 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.2 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  48173.8 total,   1397.9 free,  18955.1 used,  27820.9 buff/cache
MiB Swap:  32768.0 total,  32748.6 free,     19.4 used.   4573.7 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
  79675 shoji_n+  20   0  113.5g  41.0g  24.0g S   0.0  87.2  98:38.13 python
  79741 shoji_n+  20   0 2772784 259804 129812 S   0.0   0.5   0:00.30 torch_shm_manag
    326 root      20   0 1205196  88240  28724 S   0.0   0.2   0:03.56 python3.10
(snip)

いいなと思ったら応援しよう!