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"}
相关文章:

apex安装
安装过程复杂曲折,网上说的很多办法,貌似成功了,实际还是没起作用。 先说成功过程,执行下面命令,安装成功(当然,前提是你要先配置好编译环境): (我的环境&a…...

会员制电商创新:开源 AI 智能名片与 2+1 链动模式的协同赋能
摘要:本文聚焦于电商领域会员制的关键作用,深入探讨在传统交易模式向数字化转型过程中,如何借助开源 AI 智能名片以及 21 链动模式商城小程序,实现对会员数据的精准挖掘与高效利用,进而提升企业的营销效能与客户洞察能…...
Vue 3 和 Electron 来构建一个桌面端应用
我们将使用 Vue 3 和 Electron 来构建一个桌面端应用,该应用可以通过 Websocket 与服务器进行通信,并实现心跳检测、客户端上线、获取资产信息以及修改资产状态的功能。以下是实现步骤的概述: 项目结构:创建一个 Vue 3 项目&…...

生物医学信号处理--绪论
前言 参考书籍:刘海龙,生物医学信号处理,化学工业出版社 生物医学信号分类 1、由生理过程自发或者诱发产生的电生理信号和非电生理信号 • 电生理信号:ECG/心电、EEG/脑电、EMG/肌电、 EGG/胃电、 EOG/眼电 • 非电生理信号&am…...

STM32之CAN通讯(十一)
STM32F407 系列文章 - CAN通讯(十一) 目录 前言 一、CAN 二、CAN驱动电路 三、CAN软件设计 1.CAN状态初始化 2.头文件相关定义 3.接收中断服务函数 4.用户层使用 1.用户层相关定义 2.发送数据 3.接收数据 1.查询方式处理 2.中断方式处理 3…...

在macOS上安装MySQL
macOS的MySQL有多种不同的形式: 1、本机包安装程序,它使用本机macOS安装程序(DMG)引导您完成MySQL的安装。有关详细信息,请参阅第2.4.2节,“使用本机包在macOS上安装MySQL”。您可以将包安装程序与macOS一…...
netty解码器LengthFieldBasedFrameDecoder用法详解
Netty Netty是一个高性能、异步事件驱动的网络应用程序框架,它提供了对并发和异步编程的抽象,使得开发网络应用程序变得更加简单和高效。 在Netty中,EventLoopGroup是处理I/O操作的多线程事件循环器。在上面的示例中,我们创建了两个EventLoopGroup实例:bossGroup和worker…...
在循环链表中用头指针和用尾指针的好处
循环链表是一种特殊的链表结构,其中最后一个节点的指针指向链表的头部,形成一个环。这种结构在某些情况下可以提供便利,特别是在需要循环访问元素或者实现循环队列时。使用头指针和尾指针来操作循环链表各有其优势: 使用头指针的…...

java项目之网上租贸系统源码(springboot+mysql+vue)
风定落花生,歌声逐流水,大家好我是风歌,混迹在java圈的辛苦码农。今天要和大家聊的是一款基于springboot的网上租贸系统。项目源码以及部署相关请联系风歌,文末附上联系信息 。 项目简介: 基于Spring Boot的网上租贸…...
我用AI学Android Jetpack Compose之入门篇(3)
前一篇解释了代码,这一篇来解释脚本,gradle, compose脚本也推荐kotlin的,让Ai解释一下吧,以下答案来自 通义千问 1.解释一下下述脚本 这段代码是一个Gradle构建脚本的顶层配置文件,通常位于项目的根目录下…...
get和post有什么区别
GET和POST是HTTP协议中两种常用的请求方法,它们在用途、参数传递方式、缓存处理、安全性等方面存在显著差异。 以下是对GET和POST区别的详细讲解,并给出示例演示。 一、GET和POST的区别 用途 GET:主要用于获取信息,即进行查询操…...
编排式 Saga 模式
编排式 Saga 模式(Orchestrated Saga)是指由一个中央协调者(Orchestrator)控制多个服务间的事务执行。与协作式 Saga 模式不同,编排式 Saga 模式不依赖于事件驱动,而是通过协调者来控制整个 Saga 流程的执行…...

QT 下拉菜单设置参数 起始端口/结束端口/线程数量 端口扫描4
上篇文章QT实现 端口扫描暂停和继续功能 3-CSDN博客 双击 添加对话框类 界面设计 由于主体代码已经写完,只需要更改参数的获取即可 获取起始端口结束端口的输入 槽函数 给主界面类添加调用对话框类的功能 实现功能:点击菜单项可以弹出对话框窗体 增加槽…...
缓存-Redis-常见问题-缓存击穿-永不过期+逻辑过期(全面 易理解)
缓存击穿(Cache Breakdown) 是在高并发场景下,当某个热点数据在缓存中失效或不存在时,瞬间大量请求同时击中数据库,导致数据库压力骤增甚至崩溃的现象。为了解决这一问题,“永不过期” “逻辑过期” 的策略…...
137. 只出现一次的数字 II
137. 只出现一次的数字 II 题目-中等难度1. 位运算2. 位运算 题目-中等难度 给你一个整数数组 nums ,除某个元素仅出现 一次 外,其余每个元素都恰出现 三次 。请你找出并返回那个只出现了一次的元素。 你必须设计并实现线性时间复杂度的算法且使用常数…...

【力扣热题100】—— Day18.将有序数组转换为二叉搜索树
期末考试完毕,假期学习开始! —— 25.1.7 108. 将有序数组转换为二叉搜索树 给你一个整数数组 nums ,其中元素已经按 升序 排列,请你将其转换为一棵平衡二叉搜索树。 示例 1: 输入:nums [-10,-3,0,5,9] …...
PyTorch 官方文档 中文版本
文档来源 https://pytorch.cadn.net.cn 大多数机器学习工作流都涉及处理数据、创建模型、优化模型 参数,并保存经过训练的模型。本教程向您介绍完整的 ML 工作流 在 PyTorch 中实现,并提供了用于了解有关每个概念的更多信息的链接。 我们将使用 Fashion…...
电力智能问答RAG: 多问题生成、思维链提示生成;混合编码和重排序策略
电力智能问答RAG 目录 电力智能问答RAG文档转换、元信息抽取与增强及文档解析模块多问题生成、思维链提示生成和指令微调数据集构建模块混合编码和重排序策略文档转换、元信息抽取与增强及文档解析模块 在电力领域的知识处理中,文档转换、元信息抽取与增强及文档解析模块发挥…...
C#高级:递归4-根据一颗树递归生成数据列表
一、目的 该程序展示了如何将树形结构的数据(例如家庭成员信息)转化为一维列表形式,以便于存储、展示或操作。 二、流程思路 创建树:首先通过 GetDemoTree 创建一个简单的家庭树,树的根节点是“爸爸”,然…...

PDFelement 特别版
Wondershare PDFelement Pro 是一款非常强大的PDF编辑软件,它允许用户轻松地编辑、转换、创建和管理PDF文件。这个中文特别版的软件具有许多令人印象深刻的功能,PDFelement Pro 提供了丰富的编辑功能,可以帮助用户直接在PDF文件中添加、删除、…...

JavaSec-RCE
简介 RCE(Remote Code Execution),可以分为:命令注入(Command Injection)、代码注入(Code Injection) 代码注入 1.漏洞场景:Groovy代码注入 Groovy是一种基于JVM的动态语言,语法简洁,支持闭包、动态类型和Java互操作性,…...
Go 语言接口详解
Go 语言接口详解 核心概念 接口定义 在 Go 语言中,接口是一种抽象类型,它定义了一组方法的集合: // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的: // 矩形结构体…...
生成 Git SSH 证书
🔑 1. 生成 SSH 密钥对 在终端(Windows 使用 Git Bash,Mac/Linux 使用 Terminal)执行命令: ssh-keygen -t rsa -b 4096 -C "your_emailexample.com" 参数说明: -t rsa&#x…...

GruntJS-前端自动化任务运行器从入门到实战
Grunt 完全指南:从入门到实战 一、Grunt 是什么? Grunt是一个基于 Node.js 的前端自动化任务运行器,主要用于自动化执行项目开发中重复性高的任务,例如文件压缩、代码编译、语法检查、单元测试、文件合并等。通过配置简洁的任务…...
根目录0xa0属性对应的Ntfs!_SCB中的FileObject是什么时候被建立的----NTFS源代码分析--重要
根目录0xa0属性对应的Ntfs!_SCB中的FileObject是什么时候被建立的 第一部分: 0: kd> g Breakpoint 9 hit Ntfs!ReadIndexBuffer: f7173886 55 push ebp 0: kd> kc # 00 Ntfs!ReadIndexBuffer 01 Ntfs!FindFirstIndexEntry 02 Ntfs!NtfsUpda…...

uniapp 小程序 学习(一)
利用Hbuilder 创建项目 运行到内置浏览器看效果 下载微信小程序 安装到Hbuilder 下载地址 :开发者工具默认安装 设置服务端口号 在Hbuilder中设置微信小程序 配置 找到运行设置,将微信开发者工具放入到Hbuilder中, 打开后出现 如下 bug 解…...

云安全与网络安全:核心区别与协同作用解析
在数字化转型的浪潮中,云安全与网络安全作为信息安全的两大支柱,常被混淆但本质不同。本文将从概念、责任分工、技术手段、威胁类型等维度深入解析两者的差异,并探讨它们的协同作用。 一、核心区别 定义与范围 网络安全:聚焦于保…...

C++--string的模拟实现
一,引言 string的模拟实现是只对string对象中给的主要功能经行模拟实现,其目的是加强对string的底层了解,以便于在以后的学习或者工作中更加熟练的使用string。本文中的代码仅供参考并不唯一。 二,默认成员函数 string主要有三个成员变量,…...
字符串哈希+KMP
P10468 兔子与兔子 #include<bits/stdc.h> using namespace std; typedef unsigned long long ull; const int N 1000010; ull a[N], pw[N]; int n; ull gethash(int l, int r){return a[r] - a[l - 1] * pw[r - l 1]; } signed main(){ios::sync_with_stdio(false), …...

路由基础-路由表
本篇将会向读者介绍路由的基本概念。 前言 在一个典型的数据通信网络中,往往存在多个不同的IP网段,数据在不同的IP网段之间交互是需要借助三层设备的,这些设备具备路由能力,能够实现数据的跨网段转发。 路由是数据通信网络中最基…...