apex安装

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

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

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

git clone https://github.com/NVIDIA/apex.gitcd apexcurl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git applypip 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' extensionH:\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_75FAILED: H:/ComfyUI_cp3.11.9/apex/build/temp.win-amd64-cpython-311/Release/csrc/multi_tensor_scale_kernel.objC:\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_75C:/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 1185instantiation of class "std::_Aligned<_Len, _Align, int, false> [with _Len=16ULL, _Align=16ULL]" at line 1192instantiation of class "std::_Aligned<_Len, _Align, short, false> [with _Len=16ULL, _Align=16ULL]" at line 1199instantiation of class "std::_Aligned<_Len, _Align, char, false> [with _Len=16ULL, _Align=16ULL]" at line 1207instantiation of class "std::_Aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 1211instantiation of type "std::_Aligned_storage_t<16ULL, 16ULL>" at line 1215instantiation 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.cuinstantiation 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.cuinstantiation 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.cuhinstantiation 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.cuhinstantiation 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.cu1 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' extensionEmitting 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_75FAILED: H:/ComfyUI_cp3.11.9/apex/build/temp.win-amd64-cpython-311/Release/csrc/multi_tensor_l2norm_scale_kernel.objC:\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_75C:/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 1185instantiation of class "std::_Aligned<_Len, _Align, int, false> [with _Len=16ULL, _Align=16ULL]" at line 1192instantiation of class "std::_Aligned<_Len, _Align, short, false> [with _Len=16ULL, _Align=16ULL]" at line 1199instantiation of class "std::_Aligned<_Len, _Align, char, false> [with _Len=16ULL, _Align=16ULL]" at line 1207instantiation of class "std::_Aligned_storage<_Len, _Align> [with _Len=16ULL, _Align=16ULL]" at line 1211instantiation of type "std::_Aligned_storage_t<16ULL, 16ULL>" at line 1215instantiation 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.cuinstantiation 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.cuinstantiation 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.cuhinstantiation 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.cuhinstantiation 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.cu1 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\apexRunning 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.gitcd apexcurl -L "https://github.com/NVIDIA/apex/files/14844602/windows_support.patch" | git applyset DISTUTILS_USE_SDK=1set TORCH_CUDA_ARCH_LIST=7.5pip 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.mzph.cn/bicheng/66534.shtml

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

相关文章

shell-条件判断

目录 一、条件判断 1.按照文件类型进行判断 2.按照文件权限进行判断 3.两个文件之间进行比较 4.两个整数之间进行比较 5.字符串的判断 6.多重条件判断 二、if条件判断 1.单分支if条件语句 2.双分支if条件语句 &#xff08;1&#xff09;判断某文件是否存在 &#x…

基于FPGA的出租车里程时间计费器

基于FPGA的出租车里程时间计费器 功能描述一、系统框图二、verilog代码里程增加模块时间增加模块计算价格模块上板视频演示 总结 功能描述 &#xff08;1&#xff09;&#xff1b;里程计费功能&#xff1a;3公里以内起步价8元&#xff0c;超过3公里后每公里2元&#xff0c;其中…

将数组转换为laravel中的对象

将数组转换为laravel中的对象 在Laravel中&#xff0c;可以通过使用集合&#xff08;Collection&#xff09;来将数组转换为对象。集合是Laravel提供的一个强大的工具&#xff0c;用于处理数组数据。 将数组转换为Laravel中的对象的步骤如下&#xff1a; 首先&#xff0c;确…

jdk8升级JDK21(Springboot2.7.18升级Springboot3.4.0)

目录 背景&#xff1a; 一、maven升级 二、代码改造 2.1 javax替换为jakarta 2.2 swagger2升级swagger3相关更新 2.2.1 新增SpringDocConfig配置类 2.2.2 全局代码更新 2.2.3 全局代码替换&#xff08;普通正则替换&#xff09; 2.3 Mybatis Plus升级 2.4 logback.xm…

AI赋能跨境电商:魔珐科技3D数字人破解出海痛点

跨境出海进入狂飙时代&#xff0c;AI应用正在深度渗透并重塑着跨境电商产业链的每一个环节&#xff0c;迎来了发展的高光时刻。生成式AI时代的大幕拉开&#xff0c;AI工具快速迭代&#xff0c;为跨境电商行业的突破与飞跃带来了无限可能性。 由于跨境电商业务自身特性鲜明&…

【HarmonyOS NEXT】鸿蒙应用实现屏幕录制详解和源码

【HarmonyOS NEXT】鸿蒙应用实现屏幕录制详解和源码 一、前言 官方文档关于屏幕录制的API和示例介绍获取简单和突兀。使用起来会让上手程度变高。所以特意开篇文章&#xff0c;讲解屏幕录制的使用。官方文档参见&#xff1a;使用AVScreenCaptureRecorder录屏写文件(ArkTS) 二…

Ubuntu挂载云盘操作步骤

1. 查看磁盘分区情况 使用 fdisk -l 命令查看当前系统中所有磁盘的分区情况&#xff0c;找到需要挂载的云盘设备&#xff0c;例如/dev/vdc。 2. 创建新分区 使用 fdisk /dev/vdc 命令对云盘进行分区操作&#xff1a; 输入n创建新分区。 输入p选择创建主分区。 输入1指定分区…

stm32u5串口点灯

通过对单个字符输入的拼接暂存&#xff0c;实现对字符串的比较控制灯的亮灭 char buf[32];char temp[32];while (1){printf("start\n\r");memset(temp,0, sizeof(temp));memset(buf,0, sizeof(buf));while(temp[0] !\r){memset(temp,0, sizeof(temp));HAL_UART_Rece…

PHP 5 6 7 8 9 各重要版本开发特性和选择简要说明

PHP开发&#xff0c;所用版本的选型 PHP5.4是最后一个支持纯正32位操作系统的版本&#xff0c;在Winxp下仍可使用。 PHP5.6是php5.x的最后一个稳定版本&#xff0c;时至今天&#xff0c;仍有很多用户网站系统在使用&#xff0c;网上仍有很多学习资料是基于这个版本&#xff0c;…

Xen 虚拟化技术在云计算平台中的应用详解

Xen 虚拟化技术在云计算平台中的应用详解 随着云计算的飞速发展&#xff0c;虚拟化技术成为构建云平台的核心支柱&#xff0c;而 Xen 作为一种高性能、开源的虚拟化技术&#xff0c;被广泛应用于云计算平台中。Xen 凭借其灵活的架构和出色的性能&#xff0c;为众多云服务商提供…

Elixir语言的正则表达式

Elixir语言中的正则表达式 引言 正则表达式是用于匹配文本模式的一种强大工具。在很多编程语言中&#xff0c;正则表达式被广泛应用于字符串的查找、替换和验证。Elixir作为一门现代化的函数式编程语言&#xff0c;也提供了对正则表达式的支持&#xff0c;方便开发者进行复杂…

MATLAB语言的正则表达式

MATLAB 中的正则表达式使用指南 引言 在数据处理和文本分析中&#xff0c;正则表达式是一种强大而灵活的工具。MATLAB 作为一种广泛应用于科学计算和数据分析的编程语言&#xff0c;提供了对正则表达式的支持&#xff0c;使得用户可以方便地进行字符串匹配与处理。本文将深入…

《Java 中 Thread 类的基本用法总结》

在 Java 编程中&#xff0c;Thread类是实现多线程的核心类之一。下面将对Thread类在创建线程、线程中断、线程等待、线程休眠和获取线程实例等方面的基本用法进行总结。 一、线程创建 继承 Thread 类 定义一个类继承自Thread类。重写run方法&#xff0c;run方法中包含了该线程…

Flannel:Kubernetes 网络方案的“轻骑兵”

Flannel&#xff1a;Kubernetes 网络方案的“轻骑兵” 在 Kubernetes 中&#xff0c;网络是连接所有组件的核心。每个 Pod 都需要一个独立的 IP&#xff0c;方便 Pod 间的通信&#xff0c;而 Flannel 正是解决这个问题的经典容器网络插件&#xff08;CNI&#xff09;。它简单、…

Android - NDK:编译可执行程序在android设备上运行

在android开发中&#xff0c;调试时会把C代码直接编译成可执行程序&#xff0c;运行在android设备上以确认其功能是否正常。 1、基于NDK编译可执行文件 2、push到 /data/local/tmp目录下 3、设置权限&#xff0c;执行。 ndk工程中build.gradle设置 groovy plugins {id com.a…

用matlab调用realterm一次性发送16进制数

realterm采用PutString接口进行发送&#xff0c;需要注意的是发送的16进制数前面要加入0x标志。只有这样&#xff0c;realterm才能将输入的字符串识别为16进制数的形式。 另外,PutString函数支持两个参数输入&#xff0c;第一个参数为字符串&#xff0c;第二个参数为发送形式&…

Python3刷算法来呀,贪心系列题单

1.7号题单 1、​​​​​​k次取反后最大值 2、柠檬水找零 3、分发糖果 示例 1&#xff1a; 输入&#xff1a;ratings [1,0,2] 输出&#xff1a;5 解释&#xff1a;你可以分别给第一个、第二个、第三个孩子分发 2、1、2 颗糖果。示例 2&#xff1a; 输入&#xff1a;ratings…

Couchbase 和数据湖技术的区别、联系和相关性分析

Couchbase 和数据湖技术&#xff08;如 Delta Lake、Apache Hudi、Apache Iceberg&#xff09;分别是两类不同的数据存储与管理系统&#xff0c;但它们也可以在特定场景中结合使用&#xff0c;以下是它们的区别、联系和相关性分析&#xff1a; 区别&#xff1a; 1. 核心用途&a…

el-table拖拽表格

1、拖拽插件安装 npm i -S vuedraggable // vuedraggable依赖Sortable.js&#xff0c;我们可以直接引入Sortable使用Sortable的特性。 // vuedraggable是Sortable的一种加强&#xff0c;实现组件化的思想&#xff0c;可以结合Vue&#xff0c;使用起来更方便。 2、引入拖拽函数…

深入理解 Android 中的 KeyguardManager

深入理解 Android 中的 KeyguardManager 引言 在 Android 系统中&#xff0c;KeyguardManager 是一个重要的系统服务&#xff0c;负责管理设备的锁屏界面&#xff08;Keyguard&#xff09;。锁屏界面是设备安全性的第一道防线&#xff0c;用于防止未经授权的用户访问设备。Ke…