質問するログイン新規登録

Q&A

0回答

321閲覧

stable-point-aware-3dのrequirements.txt(texture_baker)ビルドエラー原因がわからない

magma189

総合スコア4

CUDA

CUDAは並列計算プラットフォームであり、Nvidia GPU(Graphics Processing Units)向けのプログラミングモデルです。CUDAは様々なプログラミング言語、ライブラリ、APIを通してNvidiaにインターフェイスを提供します。

PyTorch

PyTorchは、オープンソースのPython向けの機械学習ライブラリ。Facebookの人工知能研究グループが開発を主導しています。強力なGPUサポートを備えたテンソル計算、テープベースの自動微分による柔軟なニューラルネットワークの記述が可能です。

venv

venvモジュールは、軽量な仮想環境の作成を行います。それぞれの仮想環境は、site ディレクトリに独立した Python パッケージの集合を持っています。仮想環境は、ベースPythonとも呼ばれる、すでにインストールされている Python の上に作成され、明示的にインストールしたパッケージのみが利用可能となるよう、ベースPython から隔離することもできます。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

C++

C++はC言語をもとにしてつくられた最もよく使われるマルチパラダイムプログラミング言語の1つです。オブジェクト指向、ジェネリック、命令型など広く対応しており、多目的に使用されています。

0グッド

0クリップ

投稿2026/03/26 03:51

編集2026/03/27 07:17

0

0

実現したいこと

stable-point-aware-3dを仮想環境venv上に構築しようとしています。
stable-point-aware-3dのrequirements.txt(texture_baker)ビルドエラーが発生しました。
似た現象をご存じの方、原因調査方法をご存じの方、おられましたら助力願います。

発生している問題・分からないこと

pip install -vvv --log install.log --no-build-isolation -r requirements3.txt

エラーメッセージ

error

1 C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/include\cuda/std/detail/libcxx/include/cmath(1032): warning #221-D: floating-point value does not fit in required floating-point type 2 if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), ((float)(1e+300)))) 3 ^ 4 5 Remark: The warnings can be suppressed with "-diag-suppress <warning-number>" 6 7 baker_kernel.cu 8 tmpxft_00002f98_00000000-7_baker_kernel.cudafe1.cpp 9 D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1143): error C2872: 'std': あいまいなシンボルです。 10 C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/include\valarray(20): note: 'std' である可能性があります。 11 D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1143): note: または 'std' 12 D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1143): note: テンプレートインスタンス化コンテキスト (最初に最も古いもの) は 13 D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1190): note: コンパイル対象の クラス テンプレート インスタンス化 'torch::dynamo::autograd::IValuePacker<__int64>' のリファレンスを確認してください 14 D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1117): note: クラス テンプレート メンバー関数 'c10::TypePtr torch::dynamo::autograd::IValuePacker<__int64>::packed_type(void)' のコンパイル中 15 D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1190): note: 'torch::dynamo::autograd::IValuePacker<unsigned __int64>::packed_type' の 'torch::dynamo::autograd::IValuePacker<__int64>::packed_type' への最初の参照を参照してください 16 error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.8\\bin\\nvcc.exe' failed with exit code 2 17 error: subprocess-exited-with-error 18 19 × python setup.py bdist_wheel did not run successfully. 20 │ exit code: 1 21 ╰─> See above for output. 22 23 note: This error originates from a subprocess, and is likely not a problem with pip. 24 full command: 'D:\SPAW3D\venv\Scripts\python.exe' -u -c ' 25 exec(compile('"'"''"'"''"'"' 26 # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py 27 # 28 # - It imports setuptools before invoking setup.py, to enable projects that directly 29 # import from `distutils.core` to work with newer packaging standards. 30 # - It provides a clear error message when setuptools is not installed. 31 # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so 32 # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning: 33 # manifest_maker: standard file '"'"'-c'"'"' not found". 34 # - It generates a shim setup.py, for handling setup.cfg-only projects. 35 import os, sys, tokenize, traceback 36 37 try: 38 import setuptools 39 except ImportError: 40 print( 41 "ERROR: Can not execute `setup.py` since setuptools failed to import in " 42 "the build environment with exception:", 43 file=sys.stderr, 44 ) 45 traceback.print_exc() 46 sys.exit(1) 47 48 __file__ = %r 49 sys.argv[0] = __file__ 50 51 if os.path.exists(__file__): 52 filename = __file__ 53 with tokenize.open(__file__) as f: 54 setup_py_code = f.read() 55 else: 56 filename = "<auto-generated setuptools caller>" 57 setup_py_code = "from setuptools import setup; setup()" 58 59 exec(compile(setup_py_code, filename, "exec")) 60 '"'"''"'"''"'"' % ('"'"'D:\\SPAW3D\\stable-point-aware-3d\\texture_baker\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\temp\pip-wheel-y_45syxq' 61 cwd: D:\SPAW3D\stable-point-aware-3d\texture_baker\\ 62error 63 ERROR: Failed building wheel for texture_baker 64 Running setup.py clean for texture_baker 65 Running command python setup.py clean 66 [<setuptools.extension.Extension('texture_baker._C') at 0x16006639ea0>] 67 running clean 68 removing 'build\temp.win-amd64-cpython-310' (and everything under it) 69 removing 'build\lib.win-amd64-cpython-310' (and everything under it) 70 'build\bdist.win-amd64' does not exist -- can't clean it 71 'build\scripts-3.10' does not exist -- can't clean it 72 removing 'build' 73Failed to build texture_baker 74Remote version of pip: 26.0.1 75Local version of pip: 25.2 76Was pip installed by pip? True 77 78[notice] A new release of pip is available: 25.2 -> 26.0.1 79[notice] To update, run: python.exe -m pip install --upgrade pip 80error: failed-wheel-build-for-install 81 82× Failed to build installable wheels for some pyproject.toml based projects 83╰─> texture_baker 84Exception information: 85Traceback (most recent call last): 86 File "D:\SPAW3D\venv\lib\site-packages\pip\_internal\cli\base_command.py", line 107, in _run_wrapper 87 status = _inner_run() 88 File "D:\SPAW3D\venv\lib\site-packages\pip\_internal\cli\base_command.py", line 98, in _inner_run 89 return self.run(options, args) 90 File "D:\SPAW3D\venv\lib\site-packages\pip\_internal\cli\req_command.py", line 71, in wrapper 91 return func(self, options, args) 92 File "D:\SPAW3D\venv\lib\site-packages\pip\_internal\commands\install.py", line 442, in run 93 raise InstallWheelBuildError(build_failures) 94pip._internal.exceptions.InstallWheelBuildError: <InstallWheelBuildError: failed-wheel-build-for-install> 95Removed build tracker: 'C:\\temp\\pip-build-tracker-rrklnvk_'

該当のソースコード

requirement.txt ./texture_baker/

試したこと・調べたこと

  • teratailやGoogle等で検索した
  • ソースコードを自分なりに変更した
  • 知人に聞いた
  • その他
上記の詳細・結果

An error about the “texture_baker” #38
stable-point-aware-3dはStability-AI 社のstable-fast-3dの後継プロダクトなので、似たIssueがあります。
しかし、それらは今回の問題の解決に至っていません。
Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. #39
An error about the “texture_baker” #79
unable to build wheel for gpytoolbox #54

補足

■インストール環境は以下です ・PC本体: Visual Studio: 2019 C++によるデスクトップ開発 2022 C++によるデスクトップ開発 Python:python --version Python 3.10.11 他に3.14 3.12あり CUDA Toolkit:nvcc --version Cuda compilation tools, release 12.8, V12.8.61 Build cuda_12.8.r12.8/compiler.35404655_0 ・仮想環境Venv内: Python:python --version Python 3.10.11 CUDA Toolkit:nvcc --version Cuda compilation tools, release 12.8, V12.8.61 Build cuda_12.8.r12.8/compiler.35404655_0 pip list(エラー直後): Package Version albucore 0.0.16 albumentations 1.4.15 annotated-types 0.7.0 antlr4-python3-runtime 4.9.3 anyio 4.13.0 beautifulsoup4 4.14.3 certifi 2026.2.25 charset-normalizer 3.4.6 colorama 0.4.6 easydict 1.13 einops 0.7.0 eval_type_backport 0.3.1 exceptiongroup 1.3.1 filelock 3.25.2 flet 0.83.0 fsspec 2026.2.0 gdown 5.2.1 h11 0.16.0 httpcore 1.0.9 httpx 0.28.1 huggingface-hub 0.23.4 idna 3.11 ImageIO 2.37.3 jaxtyping 0.2.31 Jinja2 3.1.6 kornia 0.8.2 kornia_rs 0.1.10 lazy-loader 0.5 loralib 0.1.2 MarkupSafe 3.0.2 mpmath 1.3.0 msgpack 1.1.2 networkx 3.4.2 numpy 1.26.4 oauthlib 3.3.1 omegaconf 2.3.0 opencv-python 4.11.0.86 opencv-python-headless 4.11.0.86 packaging 26.0 pillow 12.1.1 pip 25.2 pydantic 2.12.5 pydantic_core 2.41.5 PySocks 1.7.1 PyYAML 6.0.3 regex 2026.2.28 repath 0.9.0 requests 2.33.0 safetensors 0.7.0 scikit-image 0.25.2 scipy 1.15.3 setuptools 69.5.1 six 1.17.0 soupsieve 2.8.3 sympy 1.14.0 tifffile 2025.5.10 timm 1.0.26 tokenizers 0.19.1 torch 2.11.0+cu128 torchvision 0.26.0+cu128 tqdm 4.67.3 transformers 4.42.3 transparent-background 1.3.3 trimesh 4.4.1 typeguard 2.13.3 typing_extensions 4.15.0 typing-inspection 0.4.2 urllib3 2.6.3 wget 3.2 wheel 0.46.3

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

melian

2026/03/26 08:49

参照しているウェブページにも書かれていますが、pip に -vvv オプション(verbose mode)を付けて実行してみてはどうでしょうか。 pip install -vvv --log install.log -r requirements.txt この場合、install.log ファイルにエラーの詳細(nvccによるコンパイル、もしくはリンクエラーなど)が記録されることになるかと思いますので、エラーの原因が判明するかもしれません。
magma189

2026/03/26 10:32

アドバイス頂きありがとうございます。 早速試してみます。
magma189

2026/03/26 11:01 編集

-vvvオプションを試しました、かなり情報が追加されましたので調査します。 setuptools failed to importが怪しいです。 ``` error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.8\\bin\\nvcc.exe' failed with exit code 2 error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: 'D:\SPAW3D\venv\Scripts\python.exe' -u -c ' exec(compile('"'"''"'"''"'"' # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py # # - It imports setuptools before invoking setup.py, to enable projects that directly # import from `distutils.core` to work with newer packaging standards. # - It provides a clear error message when setuptools is not installed. # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning: # manifest_maker: standard file '"'"'-c'"'"' not found". # - It generates a shim setup.py, for handling setup.cfg-only projects. import os, sys, tokenize, traceback try: import setuptools except ImportError: print( "ERROR: Can not execute `setup.py` since setuptools failed to import in " "the build environment with exception:", file=sys.stderr, ) traceback.print_exc() sys.exit(1) __file__ = %r sys.argv[0] = __file__ if os.path.exists(__file__): filename = __file__ with tokenize.open(__file__) as f: setup_py_code = f.read() else: filename = "<auto-generated setuptools caller>" setup_py_code = "from setuptools import setup; setup()" exec(compile(setup_py_code, filename, "exec")) '"'"''"'"''"'"' % ('"'"'D:\\SPAW3D\\stable-point-aware-3d\\texture_baker\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\Users\ユーザ名\AppData\Local\Temp\pip-wheel-i15w96ft' cwd: D:\SPAW3D\stable-point-aware-3d\texture_baker\\ error ERROR: Failed building wheel for texture_baker Running setup.py clean for texture_baker Running command python setup.py clean [<setuptools.extension.Extension('texture_baker._C') at 0x25703491ea0>] running clean removing 'build\temp.win-amd64-cpython-310' (and everything under it) removing 'build\lib.win-amd64-cpython-310' (and everything under it) 'build\bdist.win-amd64' does not exist -- can't clean it 'build\scripts-3.10' does not exist -- can't clean it removing 'build' Failed to build texture_baker Remote version of pip: 26.0.1 Local version of pip: 25.2 Was pip installed by pip? True [notice] A new release of pip is available: 25.2 -> 26.0.1 [notice] To update, run: python.exe -m pip install --upgrade pip error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> texture_baker ```
katsuko

2026/03/26 22:25

エラーメッセージはよく読んだほうがいいです。 最初に「nvccのコマンドが失敗した」とエラーを出しているのだから、cuda周りを確認すべきだと思いますが。(バージョンがあっているか、など) あと、本当にエラーメッセージは掲示されているものが全てですか。 nvccでエラーになっているのであれば、nvcc自体がエラーメッセージを出していてもおかしくないと思いますが。
katsuko

2026/03/26 22:34

print( "ERROR: Can not execute `setup.py` since setuptools failed to import in " "the build environment with exception:", file=sys.stderr, ) これが怪しい、と言っているのであれば、これは実行しているPythonスクリプトの一部であってエラーメッセージではないので、関係ないと思います。
magma189

2026/03/27 01:20

アドバイス有難うございます。 私の推測が誤ってましたね、NVCCのコマンドが失敗していますか。 nvcc --version →12.8 torch 2.10.0+cu128 torchvision 0.25.0+cu128 設定は正しいはずですが、ほかにも要素がありますか。 エラーメッセージはすべてではありません。一部貼り付けです。 コメント内に折りたたんで張り付けたいのですが、その方法がわかりません。 もしご存じでしたら教えてください。
katsuko

2026/03/27 04:07

長い文章はここには書かず、質問を編集して追記するなり書き換えるなりしてください。
magma189

2026/03/27 06:40

質問欄を使用するのですね、承知しました。
magma189

2026/03/27 07:21

PCのCUDA環境を再設定、Venv再作成、アプリフォルダ再構築しましたが、 エラーは解決できません。「エラーメッセージ欄」に貼り付けました。 ①GPUのドライバ595.79インストール ②Visual Studio2022をインストール ③CUDA Toolkit12.8をインストール ④cuDNN9.20をインストール
melian

2026/03/27 08:47

> D:/SPAW3D/venv/lib/site-packages/torch/include\torch/csrc/dynamo/compiled_autograd.h(1143): error C2872: 'std': あいまいなシンボルです。 質問へ追加されたログにある上記のエラーメッセージで検索してみると、以下の issue を見つけました。 error C2872: 'std': ambiguous symbol when compiling `csrc/dynamo/compiled_autograd.h` · Issue #173232 · pytorch/pytorch https://github.com/pytorch/pytorch/issues/173232 エラーが発生しているのは以下の箇所です。 pytorch/torch/csrc/dynamo/compiled_autograd.h at main · pytorch/pytorch https://github.com/pytorch/pytorch/blob/main/torch/csrc/dynamo/compiled_autograd.h#L1142 > } else if constexpr (::std::is_same_v<T, ::std::string>) { >   return at::StringType::get(); Issueのコメントでは「コンパイル時のチェックなので削除しても問題はないと思うし、削除するとエラーが解消される」と書かれています。 https://github.com/pytorch/pytorch/issues/173232#issue-3849961158 > If I delete the line with std::string, or change std::string to another type without the ::std or std prefix, the compile error goes away. In this case, I think just deleting is fine because these are compile time checks and if this code was actually being hit it would fail compilation. I don't know why I'm hitting this where others aren't (it's on a fresh install of windows and with a more recent possibly unsupported version of visual studios), but thought it was worth pointing it out. また、別のissueではnvccのコンパイルオプションに特定のオプションを追加するとよいと書かれています。 compile SageAttention faing error C2872: "std" for latest torch nightly · Issue #148317 · pytorch/pytorch https://github.com/pytorch/pytorch/issues/148317#issuecomment-3344732754 > When building an extension, we can do a quick fix like woct0rdho/SageAttention@914fe0e > > if os.name == "nt": >   NVCC_FLAGS += [ >     "-D_WIN32=1", >     "-DUSE_CUDA=1", > ] この場合は stable-point-aware-3d/texture_baker/setup.pyのextra_compile_argsにある"nvcc"キーの値に追加することになるかと思います。
magma189

2026/03/27 09:49

エラーをここまで読み込めませんでした、非常にありがたいです。以下で試してみます (setup.py line46) if debug_mode: extra_compile_args["cxx"].append("-g") if platform.system() == "Windows": extra_compile_args["cxx"].append("/Z7") extra_compile_args["cxx"].append("/Od") extra_link_args.extend(["/DEBUG"]) extra_compile_args["cxx"].append("-UNDEBUG") extra_compile_args["nvcc"].append("-UNDEBUG") extra_compile_args["nvcc"].append("-g") extra_compile_args["nvcc"].append("-D_WIN32=1") →追加 extra_compile_args["nvcc"].append("-DUSE_CUDA=1") →追加 extra_link_args.extend(["-O0", "-g"])
magma189

2026/03/27 10:12 編集

間違えました。 (setup.py line46) if debug_mode: の前(無条件)に以下を加えました。 extra_compile_args["nvcc"].append("-D_WIN32=1") →追加 extra_compile_args["nvcc"].append("-DUSE_CUDA=1") →追加 今度はエラーなく通りました。大成功です!今回は有難うございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.29%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問