From d47638c1fd7ead2710317271ac185bd45476b658 Mon Sep 17 00:00:00 2001 From: YAN Wenkun Date: Tue, 10 Sep 2024 02:31:28 +0800 Subject: [PATCH] Add env var TORCH_CUDA_ARCH_LIST --- README.adoc | 4 ++++ README.zh.adoc | 4 ++++ attachments/run_nvidia_gpu.bat | 11 +++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index c5690f4..1392f45 100644 --- a/README.adoc +++ b/README.adoc @@ -66,6 +66,10 @@ Its compiler will be needed (for some JIT code). https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local[CUDA Toolkit], latest version is fine as long as it's 12.x. +3. Edit `run_nvidia_gpu.bat`, reduce `TORCH_CUDA_ARCH_LIST` according to your +https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049[GPU arch], +to save your time on JIT compiling. + == Tips for Usage 1. Model Path: If model files are already saved in another location and you don't want to move them, you can configure the program to load them: diff --git a/README.zh.adoc b/README.zh.adoc index 0a2165c..b257ca4 100644 --- a/README.zh.adoc +++ b/README.zh.adoc @@ -60,6 +60,10 @@ https://visualstudio.microsoft.com/downloads/?q=build+tools[Visual Studio 2022 https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local[CUDA Toolkit], 最新版即可,只要大版本还在 12.x 就兼容。 +3. 编辑 `run_nvidia_gpu.bat`,根据你的 +https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049[GPU 架构] +来精简 `TORCH_CUDA_ARCH_LIST`,以节约运行时的 JIT 编译耗时。 + 此外请注意,Comfy3D 还会在执行各节点时下载所需模型,而访问 HuggingFace 可能需要挂代理。 ## 使用技巧 diff --git a/attachments/run_nvidia_gpu.bat b/attachments/run_nvidia_gpu.bat index 277a50c..f5077c9 100644 --- a/attachments/run_nvidia_gpu.bat +++ b/attachments/run_nvidia_gpu.bat @@ -3,16 +3,23 @@ rem set HTTP_PROXY=http://localhost:1081 rem set HTTPS_PROXY=http://localhost:1081 +@REM In order to save your time on compiling PyTorch JIT CPP extensions, +@REM edit this according to your GPU arch. +@REM https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049 +@REM 依照下表,修改为你的 GPU 对应架构,以节约 JIT 编译 PyTorch C++ 扩展的时间: +@REM https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049 +set TORCH_CUDA_ARCH_LIST=5.2+PTX;6.0;6.1+PTX;7.5;8.0;8.6;8.9+PTX + @REM This command will set PATH environment variable. @REM 该行命令会配置 PATH 环境变量。 -set PATH=%PATH%;%~dp0\python_embeded\Scripts\ +set PATH=%PATH%;%~dp0\python_embeded\Scripts @REM This command will let the .pyc files to be stored in one place. @REM 该行命令会使 .pyc 文件集中保存在一处。 set PYTHONPYCACHEPREFIX=.\pycache @REM If you don't want the browser to open automatically, -@REM add " --disable-auto-launch" (without quotation marks) to the end of the line below. +@REM add " --disable-auto-launch" (without quotation marks) to the end of the line below. @REM 如果不想要 ComfyUI 启动后自动打开浏览器,添加" --disable-auto-launch"(不含引号)到下行末尾。 .\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build