apex安装 [复制链接]
发表于 2025-1-8 11:59:18 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
 安装过程复杂曲折,网上说的很多办法,貌似乐成了,实际还是没起作用。
先说乐成过程,执行下面下令,安装乐成(当然,条件是你要先设置好编译情况):
(我的情况:windows10 、embeded python3.11.9 、pytorch version: 2.5.1+cu124、RTX2080ti)
  1. git clone https://github.com/NVIDIA/apex.git
  2.  
  3. cd apex
  4. curl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git apply
  5. pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" .
复制代码
这个信息,不知道是否说明我的显卡是2系(TORCH_CUDA_ARCH_LIST=7.5)?


乐成安装的apex,在卸载apex,你会发现安装的apex含有下面部件: 

---------------下面只是曲折过程,如无须要就不要浪费时间往下看了--------------
1、在comfyUI中,我安装了54个节点,只在安装了节点ComfyUI-PuLID-Flux-Enhanced后,在没有安装apex时,会有如下提示:

于是便想着要安装APEX,看看会不会速率快点,颠末了漫长而曲折的过程,终于安装乐成,但效果好像没什么变革。

从apex上述介绍中,是否表示,大多时候在Pytorch中已含相关代码?所以,究竟是否值得再花大力气去安装apex呢?尚有待进一步探究。
我的情况是python3.11.9 、pytorch version: 2.5.1+cu124
2、起首是报如下错误: 
  1.   building 'amp_C' extension
  2.   H:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1964: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
  3.   If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
  4.     warnings.warn(
  5.   Emitting ninja build file H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\build.ninja...
  6.   Compiling objects...
  7.   Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  8.   [1/7] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc --generate-dependencies-with-compile --dependency-output H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_scale_kernel.obj.d -std=c++17 --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /wd4624 -Xcompiler /wd4067 -Xcompiler /wd4068 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\torch\csrc\api\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\TH -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -IH:\ComfyUI_cp3.11.9\python_embeded\include -IH:\ComfyUI_cp3.11.9\python_embeded\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" -c H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_scale_kernel.cu -o H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_scale_kernel.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75
  9.   FAILED: H:/ComfyUI_cp3.11.9/apex/build/temp.win-amd64-cpython-311/Release/csrc/multi_tensor_scale_kernel.obj
  10.   C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc --generate-dependencies-with-compile --dependency-output H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_scale_kernel.obj.d -std=c++17 --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /wd4624 -Xcompiler /wd4067 -Xcompiler /wd4068 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\torch\csrc\api\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\TH -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -IH:\ComfyUI_cp3.11.9\python_embeded\include -IH:\ComfyUI_cp3.11.9\python_embeded\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" -c H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_scale_kernel.cu -o H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_scale_kernel.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75
  11.   C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/include\type_traits(1167): error: static assertion failed with "You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member "type" would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility (*only* for uses of aligned_storage with extended alignments). To suppress this error, please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to confirm that you want a type with an extended alignment, or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to get the old non-conforming behavior."
  12.         static_assert(_Always_false<_Aligned>,
  13.         ^
  14.             detected during:
  15.               instantiation of class "std::_Aligned<_Len, _Align, double, false> [with _Len=16ULL, _Align=16ULL]" at line 1185
  16.               instantiation of class "std::_Aligned<_Len, _Align, int, false> [with _Len=16ULL, _Align=16ULL]" at line 1192
  17.               instantiation of class "std::_Aligned<_Len, _Align, short, false> [with _Len=16ULL, _Align=16ULL]" at line 1199
  18.               instantiation of class "std::_Aligned<_Len, _Align, char, false> [with _Len=16ULL, _Align=16ULL]" at line 1207
  19.               instantiation of class "std::_Aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 1211
  20.               instantiation of type "std::_Aligned_storage_t<16ULL, 16ULL>" at line 1215
  21.               instantiation of class "std::aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 25 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_scale_kernel.cu
  22.               instantiation of "void load_store(T *, T *, int, int) [with T=float]" at line 64 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_scale_kernel.cu
  23.               instantiation of "void ScaleFunctor<in_t, out_t>::operator()(int, volatile int *, TensorListMetadata<2> &, float) [with in_t=float, out_t=float]" at line 38 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_apply.cuh
  24.               instantiation of "void multi_tensor_apply_kernel(int64_t, volatile int *, T, U, ArgTypes...) [with T=TensorListMetadata<2>, U=ScaleFunctor<float, float>, ArgTypes=<float>]" at line 109 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_apply.cuh
  25.               instantiation of "void multi_tensor_apply<depth,T,ArgTypes...>(int64_t, int64_t, const at::Tensor &, const std::vector<std::vector<at::Tensor, std::allocator<at::Tensor>>, std::allocator<std::vector<at::Tensor, std::allocator<at::Tensor>>>> &, T, ArgTypes...) [with depth=2, T=ScaleFunctor<float, float>, ArgTypes=<float>]" at line 124 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_scale_kernel.cu
  26.   1 error detected in the compilation of "H:/ComfyUI_cp3.11.9/apex/csrc/multi_tensor_scale_kernel.cu".
  27.   multi_tensor_scale_kernel.cu
复制代码
 针对出现的第一个错误:
  1. H:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py:1964: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
  2.   If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
复制代码
参考文章《如何设置 TORCH_CUDA_ARCH_LIST 情况变量以优化 PyTorch 性能》,我的显卡是RTX2080Ti,所以设置:
  1. set TORCH_CUDA_ARCH_LIST=7.5
复制代码
再次编译,错误信息如下:
  1.   已完成代码的生成
  2.   building 'amp_C' extension
  3.   Emitting ninja build file H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\build.ninja...
  4.   Compiling objects...
  5.   Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  6.   [1/14] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc --generate-dependencies-with-compile --dependency-output H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_l2norm_scale_kernel.obj.d -std=c++17 --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /wd4624 -Xcompiler /wd4067 -Xcompiler /wd4068 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\torch\csrc\api\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\TH -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -IH:\ComfyUI_cp3.11.9\python_embeded\include -IH:\ComfyUI_cp3.11.9\python_embeded\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" -c H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_l2norm_scale_kernel.cu -o H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_l2norm_scale_kernel.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75
  7.   FAILED: H:/ComfyUI_cp3.11.9/apex/build/temp.win-amd64-cpython-311/Release/csrc/multi_tensor_l2norm_scale_kernel.obj
  8.   C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc --generate-dependencies-with-compile --dependency-output H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_l2norm_scale_kernel.obj.d -std=c++17 --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /wd4624 -Xcompiler /wd4067 -Xcompiler /wd4068 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\torch\csrc\api\include -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\TH -IH:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -IH:\ComfyUI_cp3.11.9\python_embeded\include -IH:\ComfyUI_cp3.11.9\python_embeded\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" -c H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_l2norm_scale_kernel.cu -o H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\csrc/multi_tensor_l2norm_scale_kernel.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75
  9.   C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/include\type_traits(1167): error: static assertion failed with "You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member "type" would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility (*only* for uses of aligned_storage with extended alignments). To suppress this error, please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to confirm that you want a type with an extended alignment, or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to get the old non-conforming behavior."
  10.         static_assert(_Always_false<_Aligned>,
  11.         ^
  12.             detected during:
  13.               instantiation of class "std::_Aligned<_Len, _Align, double, false> [with _Len=16ULL, _Align=16ULL]" at line 1185
  14.               instantiation of class "std::_Aligned<_Len, _Align, int, false> [with _Len=16ULL, _Align=16ULL]" at line 1192
  15.               instantiation of class "std::_Aligned<_Len, _Align, short, false> [with _Len=16ULL, _Align=16ULL]" at line 1199
  16.               instantiation of class "std::_Aligned<_Len, _Align, char, false> [with _Len=16ULL, _Align=16ULL]" at line 1207
  17.               instantiation of class "std::_Aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 1211
  18.               instantiation of type "std::_Aligned_storage_t<16ULL, 16ULL>" at line 1215
  19.               instantiation of class "std::aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 24 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_l2norm_scale_kernel.cu
  20.               instantiation of "void load_store(T *, T *, int, int) [with T=float]" at line 75 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_l2norm_scale_kernel.cu
  21.               instantiation of "void L2NormScaleFunctor<in_t, out_t>::operator()(int, volatile int *, TensorListMetadata<2> &, float *, float *, float, __nv_bool, int) [with in_t=float, out_t=float]" at line 38 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_apply.cuh
  22.               instantiation of "void multi_tensor_apply_kernel(int64_t, volatile int *, T, U, ArgTypes...) [with T=TensorListMetadata<2>, U=L2NormScaleFunctor<float, float>, ArgTypes=<float *, float *, float, __nv_bool, int>]" at line 109 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_apply.cuh
  23.               instantiation of "void multi_tensor_apply<depth,T,ArgTypes...>(int64_t, int64_t, const at::Tensor &, const std::vector<std::vector<at::Tensor, std::allocator<at::Tensor>>, std::allocator<std::vector<at::Tensor, std::allocator<at::Tensor>>>> &, T, ArgTypes...) [with depth=2, T=L2NormScaleFunctor<float, float>, ArgTypes=<float *, float *, float, __nv_bool, int>]" at line 292 of H:\ComfyUI_cp3.11.9\apex\csrc\multi_tensor_l2norm_scale_kernel.cu
  24.   1 error detected in the compilation of "H:/ComfyUI_cp3.11.9/apex/csrc/multi_tensor_l2norm_scale_kernel.cu".
  25.   multi_tensor_l2norm_scale_kernel.cu
复制代码
3、无奈之下,想着试试 torch.__version__  = 2.5.1+cpu时,错误信息提示如下:
  1. H:\ComfyUI_cp3.11.9\apex>..\python_embeded\python -m pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" .
  2. Using pip 24.3.1 from H:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\pip (python 3.11)
  3. Processing h:\comfyui_cp3.11.9\apex
  4.   Running command Preparing metadata (pyproject.toml)
  5.   Warning: Torch did not find available GPUs on this system.
  6.    If your intention is to cross-compile, this is not an error.
  7.   By default, Apex will cross-compile for Pascal (compute capabilities 6.0, 6.1, 6.2),
  8.   Volta (compute capability 7.0), Turing (compute capability 7.5),
  9.   and, if the CUDA version is >= 11.0, Ampere (compute capability 8.0).
  10.   If you wish to cross-compile for a single specific architecture,
  11.   export TORCH_CUDA_ARCH_LIST="compute capability" before running setup.py.
  12.   torch.__version__  = 2.5.1+cpu
复制代码
4、文章《NVIDIA APEX安装完全指南及Megatron-LM/Pytorch运行题目解决》 
切换到差别的分支:从 GitHub - NVIDIA/apex: A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch 的标签页中,可以知道发布版本,不至于在众多的分支中无所适从。


 切换到分支:24.04.01-devel
不带参数,表现如今所选分支,git clone的初始分支为master:

  1. git checkout 24.04.01-devel
复制代码

依然报错。
5、参考文章《利用 Visual Studio 2022、CUDA 12.1 和 PyTorch 2.2.2 举行 Windows 编译的最新补丁 #1792》
以下只是想完全照抄原文,利用捏造情况编译,终极因为我是利用的embeddable python,需要搭建太多东西,放弃,以下只是记录尝试过程中的一些知识。
-------------------------------------------------------------------------------------------------------
文章里的路径,与我的情况并不一样,所以利用dir /x 查看短路径,并且只能一级一级查看:

终极,我的路径如下: 
  1. cmd /c 'C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\AUXILI~1\Build\VCVARS~1.BAT amd64 & busybox64u sh -ilX'
复制代码
将情况中文件复制到windows文件夹,文件夹需要双 \\ :


创建的捏造情况,以及git clone 的路径,在“C:\Users\你的用户名” 路径下。
----------------------------------------------------------------------------------------
受文章启发,直接在我的情况中再次安装(执行下面下令生成的whl要比文章头的下令较小,不知道是否因为设置了TORCH_CUDA_ARCH_LIST=7.5只针对我的RTX2080ti):
  1. git clone https://github.com/NVIDIA/apex.git
  2. cd apex
  3. curl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git apply
  4. set DISTUTILS_USE_SDK=1
  5. set TORCH_CUDA_ARCH_LIST=7.5
  6. pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" .
复制代码
颠末十几分钟,安装乐成(如欲将编译乐成的whl文件生存下来,需要在编译乐成,要举行安装时,按下暂停键Pause,从缓存路径将文件复制,否则,装完后,文件会被删除)。 
乐成后,再次启动comfyUI,没有了开始提到的信息。
编译乐成后,缓存里面有个文件origin.json,有如下内容,不知道与文章中提到的url有关联?:
   {"dir_info": {}, "url": "file:///H:/ComfyUI_cp3.11.9/apex"}
  


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表