apex安装

news2025/1/8 12:45:15

 安装过程复杂曲折,网上说的很多办法,貌似成功了,实际还是没起作用。

先说成功过程,执行下面命令,安装成功(当然,前提是你要先配置好编译环境):

(我的环境:windows10 、embeded python3.11.9 、pytorch version: 2.5.1+cu124、RTX2080ti)

git clone https://github.com/NVIDIA/apex.git
 
cd apex

curl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git apply

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、首先是报如下错误: 

  building 'amp_C' extension
  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.
  If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
    warnings.warn(
  Emitting ninja build file H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\build.ninja...
  Compiling objects...
  Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  [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
  FAILED: H:/ComfyUI_cp3.11.9/apex/build/temp.win-amd64-cpython-311/Release/csrc/multi_tensor_scale_kernel.obj
  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
  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."
        static_assert(_Always_false<_Aligned>,
        ^
            detected during:
              instantiation of class "std::_Aligned<_Len, _Align, double, false> [with _Len=16ULL, _Align=16ULL]" at line 1185
              instantiation of class "std::_Aligned<_Len, _Align, int, false> [with _Len=16ULL, _Align=16ULL]" at line 1192
              instantiation of class "std::_Aligned<_Len, _Align, short, false> [with _Len=16ULL, _Align=16ULL]" at line 1199
              instantiation of class "std::_Aligned<_Len, _Align, char, false> [with _Len=16ULL, _Align=16ULL]" at line 1207
              instantiation of class "std::_Aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 1211
              instantiation of type "std::_Aligned_storage_t<16ULL, 16ULL>" at line 1215
              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
              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
              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
              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
              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



  1 error detected in the compilation of "H:/ComfyUI_cp3.11.9/apex/csrc/multi_tensor_scale_kernel.cu".

  multi_tensor_scale_kernel.cu

 针对出现的第一个错误:

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.
  If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].

参考文章《如何设置 TORCH_CUDA_ARCH_LIST 环境变量以优化 PyTorch 性能》,我的显卡是RTX2080Ti,所以设置:

set TORCH_CUDA_ARCH_LIST=7.5

再次编译,错误信息如下:

  已完成代码的生成
  building 'amp_C' extension
  Emitting ninja build file H:\ComfyUI_cp3.11.9\apex\build\temp.win-amd64-cpython-311\Release\build.ninja...
  Compiling objects...
  Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  [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
  FAILED: H:/ComfyUI_cp3.11.9/apex/build/temp.win-amd64-cpython-311/Release/csrc/multi_tensor_l2norm_scale_kernel.obj
  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
  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."
        static_assert(_Always_false<_Aligned>,
        ^
            detected during:
              instantiation of class "std::_Aligned<_Len, _Align, double, false> [with _Len=16ULL, _Align=16ULL]" at line 1185
              instantiation of class "std::_Aligned<_Len, _Align, int, false> [with _Len=16ULL, _Align=16ULL]" at line 1192
              instantiation of class "std::_Aligned<_Len, _Align, short, false> [with _Len=16ULL, _Align=16ULL]" at line 1199
              instantiation of class "std::_Aligned<_Len, _Align, char, false> [with _Len=16ULL, _Align=16ULL]" at line 1207
              instantiation of class "std::_Aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 1211
              instantiation of type "std::_Aligned_storage_t<16ULL, 16ULL>" at line 1215
              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
              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
              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
              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
              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



  1 error detected in the compilation of "H:/ComfyUI_cp3.11.9/apex/csrc/multi_tensor_l2norm_scale_kernel.cu".

  multi_tensor_l2norm_scale_kernel.cu

3、无奈之下,想着试试 torch.__version__  = 2.5.1+cpu时,错误信息提示如下:

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" .
Using pip 24.3.1 from H:\ComfyUI_cp3.11.9\python_embeded\Lib\site-packages\pip (python 3.11)
Processing h:\comfyui_cp3.11.9\apex
  Running command Preparing metadata (pyproject.toml)

  Warning: Torch did not find available GPUs on this system.
   If your intention is to cross-compile, this is not an error.
  By default, Apex will cross-compile for Pascal (compute capabilities 6.0, 6.1, 6.2),
  Volta (compute capability 7.0), Turing (compute capability 7.5),
  and, if the CUDA version is >= 11.0, Ampere (compute capability 8.0).
  If you wish to cross-compile for a single specific architecture,
  export TORCH_CUDA_ARCH_LIST="compute capability" before running setup.py.

  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:

git checkout 24.04.01-devel

依然报错。

5、参考文章《使用 Visual Studio 2022、CUDA 12.1 和 PyTorch 2.2.2 进行 Windows 编译的最新补丁 #1792》

以下只是想完全照抄原文,使用虚拟环境编译,最终因为我是使用的embeddable python,需要搭建太多东西,放弃,以下只是记录尝试过程中的一些知识。

-------------------------------------------------------------------------------------------------------

文章里的路径,与我的环境并不一样,所以使用dir /x 查看短路径,并且只能一级一级查看:

最终,我的路径如下: 

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):

git clone https://github.com/NVIDIA/apex.git

cd apex

curl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git apply

set DISTUTILS_USE_SDK=1

set TORCH_CUDA_ARCH_LIST=7.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" .

经过十几分钟,安装成功(如欲将编译成功的whl文件保存下来,需要在编译成功,要进行安装时,按下暂停键Pause,从缓存路径将文件复制,否则,装完后,文件会被删除)。 

成功后,再次启动comfyUI,没有了开始提到的信息。

编译成功后,缓存里面有个文件origin.json,有如下内容,不知道与文章中提到的url有关联?:

{"dir_info": {}, "url": "file:///H:/ComfyUI_cp3.11.9/apex"}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2273218.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

select下拉框,首次进入页面没有显示value的情况

bug场景&#xff1a; 类似这种bug情况排查如下&#xff1a; 首先 理解含义 options就是存放键值对的&#xff0c;id就是key&#xff0c;对上了它就自动把label显示 而且如果你用来当作key和label的字段&#xff0c;与后端返回的不一致&#xff0c;还可以进行更改 其次 排查接…

krpano 实现文字热点中的三角形和竖杆

krpano 实现文字热点中的三角形和竖杆 实现文字热点中的三角形和竖杆 一个后端写前端真的是脑阔疼 一个后端写前端真的是脑阔疼 一个后端写前端真的是脑阔疼 实现文字热点中的三角形和竖杆 上图看效果 v&#xff1a;2549789059

playwright 录制

一、新建项目TestProject3 二、准备swagger 三、开始录制 打开PowerShell 7 (x64) cd D:\xxx\xxx\VS2022Projects\TestProject3\TestProject3\bin\Debug\net8.0 pwsh playwright.ps1 codegen --targetcsharp -b chromium localhost:5252/swagger/index.html #支持的语言 java…

uni-app 资源引用(绝对路径和相对路径)方法汇总

文章目录 一、前言&#x1f343;二、绝对路径和相对路径2.1 绝对路径2.2 相对路径 三、引用组件四、引用js4.1 js 文件引入4.2 NPM支持 五、引用css六、引用json6.1 json文件引入 七、引用静态资源7.1 模板内引入静态资源7.2 css 引入静态资源7.3 js/uts 引入静态资源7.4 静态资…

go如何从入门进阶到高级

针对Go语言的学习&#xff0c;不同阶段应采取不同的学习方式&#xff0c;以达到最佳效果.本文将Go的学习分为入门、实战、进阶三个阶段&#xff0c;下面分别详细介绍 一、社区 Go语言中文网 作为专注于Go语言学习与推广的平台&#xff0c;Go语言中文网为开发者提供了丰富的中…

现代密码学期末重点(备考ing)

现代密码学期末重点&#xff0c;个人备考笔记哦 密码学概念四种密码学攻击方法什么是公钥密码&#xff1f;什么是对称密码&#xff1f;什么是无条件密码&#xff1f; 中国剩余定理&#xff08;必考&#xff09;什么是原根什么是阶 经典密码学密码体制什么是列置换&#xff1f; …

基于SMT32U575RIT单片机-中断练习

任务 查看手册对所有的拓展板上和相对应的底板的引脚对应的端口找到以下结论 通过STM32MX软件对各个引脚进行相应的配置 1.第一种切换模式电脑发送 #include "main.h" #include "icache.h" #include "usart.h" #include "gpio.h"/*…

KCP解读:拥塞控制

本文是系列文章中的一篇&#xff0c;内容由浅到深进行剖析&#xff0c;为了方便理解建议按顺序一一阅读。 KCP技术原理 KCP解读&#xff1a;基础消息收发 KCP解读&#xff1a;重传机制 KCP解读&#xff1a;滑动窗口 KCP解读&#xff1a;拥塞控制 本文摘取https://xiaolincodin…

HCIA-Access V2.5_8_2_EPON基本架构和关键参数

EPON数据利用方式 EPON和GPON同样只有一根光纤&#xff0c;所以为了避免双向发送数据出现冲突&#xff0c;我们同样采用WDM技术&#xff0c;那么主要利用两个波长&#xff0c;一个是1490纳米的波长&#xff0c;一个是1310纳米的波长&#xff0c;下行OLT给ONU发送数据的时候&…

如何快速上手一个鸿蒙工程

作为一名鸿蒙程序猿&#xff0c;当你换了一家公司&#xff0c;或者被交接了一个已有的业务。前辈在找你之前十分钟写了一个他都看不懂的交接文档&#xff0c;然后把一个鸿蒙工程交接给你了&#xff0c;说以后就是你负责了。之后几天你的状态大概就是下边这样的&#xff0c;一堆…

FPGA实现UART对应的电路和单片机内部配合寄存器实现的电路到底有何区别?

一、UART相关介绍 UART是我们常用的全双工异步串行总线&#xff0c;常用TTL电平标准&#xff0c;由TXD和RXD两根收发数据线组成。 那么&#xff0c;利用硬件描述语言实现UART对应的电路和51单片机内部配合寄存器实现的电路到底有何区别呢&#xff1f;接下来我们对照看一下。 …

patchwork++地面分割学习笔记

参考资料&#xff1a;古月居 - ROS机器人知识分享社区 https://zhuanlan.zhihu.com/p/644297447 patchwork算法一共包含四部分内容&#xff1a;提出了以下四个部分&#xff1a;RNR、RVPF、A-GLE 和 TGR。 1&#xff09;基于 3D LiDAR 反射模型的反射噪声消除 (RNR)&#xff…

【VScode】设置代理,通过代理连接服务器

文章目录 VScode编辑器设置代理1.图形化界面1.1 进入proxy设置界面1.2 配置代理服务器 2.配置文件&#xff08;推荐&#xff09;2.1 打开setting.json 文件2.2 配置代理 VScode编辑器设置代理 根据情况安装nmap 1.图形化界面 1.1 进入proxy设置界面 或者使用快捷键ctrl , 。…

【HarmonyOS】鸿蒙应用点9图的处理(draw9patch)

【HarmonyOS】鸿蒙应用点9图的处理&#xff08;draw9patch&#xff09; 一、前言&#xff1a; 首先在鸿蒙中是不支持安卓 .9图的图片直接使用。只有类似拉伸的处理方案&#xff0c;鸿蒙提供的Image组件有与点九图相同功能的API设置。 可以通过设置resizable属性来设置Resiza…

光伏仿真与设计系统应用架构深度剖析

在光伏产业蓬勃发展的时代背景下&#xff0c;绿虫光伏仿真与设计系统成为推动其高效发展的核心力量。其应用架构涵盖多个关键步骤&#xff0c;每个环节都紧密相扣&#xff0c;共同构建起精准且高效的设计体系。 气象分析作为开篇之笔&#xff0c;起着基石般的重要作用。系统全…

k8s dashboard离线部署步骤

确定k8s版本&#xff0c;以1.23为例。 部署metrics-server服务&#xff0c;最好用v0.5.2。 用v0.6.0&#xff0c;可能会报以下错误&#xff1a; nodekubemaster:~/Desktop/metric$ kubectl top nodes Error from server (ServiceUnavailable): the server is currently unabl…

05-Linux系统编程之进程(下)

一、子进程资源回收 1.概述 在每个进程退出的时候&#xff0c;内核释放该进程所有的资源&#xff0c;包括一些存储在栈区、全局区的数据、打开的文件、占用的内存等。但是仍有一部分信息没有释放&#xff0c;这些信息主要指进程控制块 PCB 的信息&#xff08;包括进程号、退出…

HDFS异构存储和存储策略

一、HDFS异构存储类型 1.1 冷、热、温、冻数据 通常&#xff0c;公司或者组织总是有相当多的历史数据占用昂贵的存储空间。典型的数据使用模式是新传入的数据被应用程序大量使用&#xff0c;从而该数据被标记为"热"数据。随着时间的推移&#xff0c;存储的数据每周…

【51单片机】02LED流水灯实验

点亮你的LED 一、点亮第一个LED1.GPIO介绍2.P1、P2、P3端口 二、LED实验2.尝试点亮LED3.LED流水灯 一、点亮第一个LED 1.GPIO介绍 这块内容这里可以做简单的了解&#xff0c;与数电知识强相关。后续可以再回过头来学习 GPIO (general purpose input output) 通用输入输出端口…

springboot 集成 etcd

springboot 集成 etcd 往期内容 ETCD 简介docker部署ETCD 前言 好久不见各位小伙伴们&#xff0c;上两期内容中&#xff0c;我们对于分布式kv存储中间件有了简单的认识&#xff0c;完成了docker-compose 部署etcd集群以及可视化工具 etcd Keeper&#xff0c;既然有了认识&a…