実現したいこと
google colabでblenderのレンダリングを実現させたい
発生している問題・分からないこと
os.environ["LD_PRELOAD"] = ""この意味と何をどのように入力すればいいのかわかりません。
該当のソースコード
import os os.environ["LD_PRELOAD"] = "" !apt update !apt remove libtcmalloc-minimal4 !apt install libtcmalloc-minimal4 os.environ["LD_PRELOAD"] = "/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0" !echo $LD_PRELOAD
Get:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,626 B] Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease [1,581 B] Get:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages [1,196 kB] Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] Get:5 https://r2u.stat.illinois.edu/ubuntu jammy InRelease [6,555 B] Get:6 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages [8,543 kB] Hit:7 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease Hit:8 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease Hit:9 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease Get:10 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,458 kB] Get:11 https://r2u.stat.illinois.edu/ubuntu jammy/main amd64 Packages [2,626 kB] Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,226 kB] Hit:13 http://archive.ubuntu.com/ubuntu jammy InRelease Get:14 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] Get:15 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB] Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,516 kB] Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2,753 kB] Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [3,475 kB] Fetched 24.2 MB in 11s (2,257 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 58 packages can be upgraded. Run 'apt list --upgradable' to see them. W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?) Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: google-perftools libgoogle-perftools4 libtcmalloc-minimal4 0 upgraded, 0 newly installed, 3 to remove and 58 not upgraded. After this operation, 1,817 kB disk space will be freed. (Reading database ... 123633 files and directories currently installed.) Removing google-perftools (2.9.1-0ubuntu3) ... Removing libgoogle-perftools4:amd64 (2.9.1-0ubuntu3) ... Removing libtcmalloc-minimal4:amd64 (2.9.1-0ubuntu3) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for libc-bin (2.35-0ubuntu3.4) ... /sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: libtcmalloc-minimal4 0 upgraded, 1 newly installed, 0 to remove and 58 not upgraded. Need to get 98.2 kB of archives. After this operation, 382 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libtcmalloc-minimal4 amd64 2.9.1-0ubuntu3 [98.2 kB] Fetched 98.2 kB in 9s (11.2 kB/s) Selecting previously unselected package libtcmalloc-minimal4:amd64. (Reading database ... 123608 files and directories currently installed.) Preparing to unpack .../libtcmalloc-minimal4_2.9.1-0ubuntu3_amd64.deb ... Unpacking libtcmalloc-minimal4:amd64 (2.9.1-0ubuntu3) ... Setting up libtcmalloc-minimal4:amd64 (2.9.1-0ubuntu3) ... Processing triggers for libc-bin (2.35-0ubuntu3.4) ... /sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. /usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
https://harkerhack.com/blender-rendered-in-coraboratory/
このリンクの内容を参考にしています。
補足
プログラミング初心者ですので簡単に説明していただけると助かります...
組んだ本人にしか意図は分からないので、知りたいなら直接聞くべきでしょう。
ただ、「os.environ["LD_PRELOAD"] = "/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0"」ですぐに上書きされているので、空白のままで実行すればいいような気もします。
記事がそこそこ古いのでインストールされるファイルのバージョンが変わっているのではないでしょうか。
!ls /usr/lib/x86_64-linux-gnu
とかしてみて、/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0 の 4.3.0 の部分が実際にはいくつのものがインストールされているか確認してみてはどうでしょう。