Stability-AI / stable-fast-3d

SF3D: Stable Fast 3D Mesh Reconstruction with UV-unwrapping and Illumination Disentanglement
https://stable-fast-3d.github.io
Other
975 stars 86 forks source link

ValueError: cl.exe not found in default Visual Studio installation path #14

Closed MNeMoNiCuZ closed 1 month ago

MNeMoNiCuZ commented 1 month ago
(venv) C:\AI\stable-fast-3d>py gradio_app.py
C:\AI\stable-fast-3d\sf3d\models\network.py:68: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @custom_fwd(cast_inputs=torch.float32)
C:\AI\stable-fast-3d\sf3d\models\network.py:74: FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., device_type='cuda')` instead.
  @custom_bwd
open_clip_pytorch_model.bin: 100%|██████████████████████████████████████████████| 605M/605M [00:16<00:00, 37.5MB/s]
C:\AI\stable-fast-3d\venv\Lib\site-packages\open_clip\factory.py:129: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(checkpoint_path, map_location=map_location)
Traceback (most recent call last):
  File "C:\AI\stable-fast-3d\gradio_app.py", line 43, in <module>
    model = SF3D.from_pretrained(
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\system.py", line 89, in from_pretrained
    model = cls(cfg)
            ^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\models\utils.py", line 29, in __init__
    self.configure(*args, **kwargs)
  File "C:\AI\stable-fast-3d\sf3d\system.py", line 139, in configure
    self.baker = TextureBaker()
                 ^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\texture_baker.py", line 13, in __init__
    self.baker = slangtorch.loadModule(
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 652, in loadModule
    rawModule = _loadModule(fileName, moduleName, buildDir, options, sourceDir=outputFolder, verbose=verbose, includePaths=includePaths, dryRun=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 571, in _loadModule
    slangLib, metadata = compileAndLoadModule(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 460, in compileAndLoadModule
    slangLib = _compileAndLoadModule(metadata, sources, moduleName, buildDir, slangSourceDir, verbose)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 480, in _compileAndLoadModule
    _add_msvc_to_env_var()
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 112, in _add_msvc_to_env_var
    path_to_add = find_cl()
                  ^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 103, in find_cl
    raise ValueError("cl.exe not found in default Visual Studio installation path")
ValueError: cl.exe not found in default Visual Studio installation path

Not quite sure what to do. I have Visual Studio 2022 installed.

I have tried adding C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64 to my PATH, but it still shows:

(venv) C:\AI\stable-fast-3d>py gradio_app.py
C:\AI\stable-fast-3d\sf3d\models\network.py:68: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @custom_fwd(cast_inputs=torch.float32)
C:\AI\stable-fast-3d\sf3d\models\network.py:74: FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., device_type='cuda')` instead.
  @custom_bwd
C:\AI\stable-fast-3d\venv\Lib\site-packages\open_clip\factory.py:129: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(checkpoint_path, map_location=map_location)
Traceback (most recent call last):
  File "C:\AI\stable-fast-3d\gradio_app.py", line 43, in <module>
    model = SF3D.from_pretrained(
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\system.py", line 89, in from_pretrained
    model = cls(cfg)
            ^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\models\utils.py", line 29, in __init__
    self.configure(*args, **kwargs)
  File "C:\AI\stable-fast-3d\sf3d\system.py", line 139, in configure
    self.baker = TextureBaker()
                 ^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\texture_baker.py", line 13, in __init__
    self.baker = slangtorch.loadModule(
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 652, in loadModule
    rawModule = _loadModule(fileName, moduleName, buildDir, options, sourceDir=outputFolder, verbose=verbose, includePaths=includePaths, dryRun=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 571, in _loadModule
    slangLib, metadata = compileAndLoadModule(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 460, in compileAndLoadModule
    slangLib = _compileAndLoadModule(metadata, sources, moduleName, buildDir, slangSourceDir, verbose)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 480, in _compileAndLoadModule
    _add_msvc_to_env_var()
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 112, in _add_msvc_to_env_var
    path_to_add = find_cl()
                  ^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 103, in find_cl
    raise ValueError("cl.exe not found in default Visual Studio installation path")
ValueError: cl.exe not found in default Visual Studio installation path
FishGPT commented 1 month ago

You also need install: MSVC v143 - VS 2022 C++ x64/x86

If still fail, try install full development suit: C++ core desktop features

Image Details

MNeMoNiCuZ commented 1 month ago

You also need install: MSVC v143 - VS 2022 C++ x64/x86

If still fail, try install full development suit: C++ core desktop features

Image Details

Thanks for the advice.

I tried installing just the first one, then the full C++ core desktop features.

Now my output is this:

(venv) C:\AI\stable-fast-3d>py gradio_app.py
C:\AI\stable-fast-3d\sf3d\models\network.py:68: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @custom_fwd(cast_inputs=torch.float32)
C:\AI\stable-fast-3d\sf3d\models\network.py:74: FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., device_type='cuda')` instead.
  @custom_bwd
C:\AI\stable-fast-3d\venv\Lib\site-packages\open_clip\factory.py:129: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(checkpoint_path, map_location=map_location)
C:\AI\stable-fast-3d\venv\Lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
  warnings.warn(
Traceback (most recent call last):
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 2105, in _run_ninja_build
    subprocess.run(
  File "C:\Python312\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\AI\stable-fast-3d\gradio_app.py", line 43, in <module>
    model = SF3D.from_pretrained(
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\system.py", line 89, in from_pretrained
    model = cls(cfg)
            ^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\models\utils.py", line 29, in __init__
    self.configure(*args, **kwargs)
  File "C:\AI\stable-fast-3d\sf3d\system.py", line 139, in configure
    self.baker = TextureBaker()
                 ^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\sf3d\texture_baker.py", line 13, in __init__
    self.baker = slangtorch.loadModule(
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 652, in loadModule
    rawModule = _loadModule(fileName, moduleName, buildDir, options, sourceDir=outputFolder, verbose=verbose, includePaths=includePaths, dryRun=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 571, in _loadModule
    slangLib, metadata = compileAndLoadModule(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 460, in compileAndLoadModule
    slangLib = _compileAndLoadModule(metadata, sources, moduleName, buildDir, slangSourceDir, verbose)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\slangtorch.py", line 501, in _compileAndLoadModule
    return jit_compile(
           ^^^^^^^^^^^^
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\slangtorch\util\compile.py", line 71, in jit_compile
    _write_ninja_file_and_build_library(
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 1834, in _write_ninja_file_and_build_library
    _run_ninja_build(
  File "C:\AI\stable-fast-3d\venv\Lib\site-packages\torch\utils\cpp_extension.py", line 2121, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error building extension '_slangtorch_texture_baker_44136fa355b3678a': [1/2] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc --generate-dependencies-with-compile --dependency-output texture_baker_cuda.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=_slangtorch_texture_baker_44136fa355b3678a -DTORCH_API_INCLUDE_EXTENSION_H -IC:\AI\stable-fast-3d\sf3d -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include\torch\csrc\api\include -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include\TH -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -IC:\Python312\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 --std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ -DSLANG_CUDA_ENABLE_HALF=1 -c C:\AI\stable-fast-3d\sf3d\.slangtorch_cache\texture_baker\44136fa355b3678a\texture_baker_cuda.cu -o texture_baker_cuda.cuda.o
FAILED: texture_baker_cuda.cuda.o
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc --generate-dependencies-with-compile --dependency-output texture_baker_cuda.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=_slangtorch_texture_baker_44136fa355b3678a -DTORCH_API_INCLUDE_EXTENSION_H -IC:\AI\stable-fast-3d\sf3d -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include\torch\csrc\api\include -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include\TH -IC:\AI\stable-fast-3d\venv\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -IC:\Python312\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 --std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ -DSLANG_CUDA_ENABLE_HALF=1 -c C:\AI\stable-fast-3d\sf3d\.slangtorch_cache\texture_baker\44136fa355b3678a\texture_baker_cuda.cu -o texture_baker_cuda.cuda.o
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_OPERATORS__' with '/U__CUDA_NO_HALF_OPERATORS__'
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_CONVERSIONS__' with '/U__CUDA_NO_HALF_CONVERSIONS__'
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF2_OPERATORS__' with '/U__CUDA_NO_HALF2_OPERATORS__'
cl : Command line warning D9025 : overriding '/D__CUDA_NO_BFLOAT16_CONVERSIONS__' with '/U__CUDA_NO_BFLOAT16_CONVERSIONS__'
texture_baker_cuda.cu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include\crt/host_config.h(153): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
texture_baker_cuda.cu
ninja: build stopped: subcommand failed.

Stupid ninjas, sabotaging me!

FishGPT commented 1 month ago

Visual Studio 2022 (17.10+) atleast using CUDA 12.4 version with CUDNN 9.3

MNeMoNiCuZ commented 1 month ago

Visual Studio 2022 (17.10+) atleast using CUDA 12.4 version with CUDNN 9.3

image

Thank you! <3 This fixed it. Both of those were necessary. I can now launch!

Next errors in a new issue coming up :D