From 0436681dbd265741a9fa62e06f27d56eb9fdc3c1 Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Sun, 12 Jan 2025 20:16:57 -0500 Subject: [PATCH 1/8] fix: handle zero ram cache case --- args.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/args.py b/args.py index 46dd57c..3a92de0 100644 --- a/args.py +++ b/args.py @@ -64,6 +64,8 @@ if args.cache is not None: args.max_cache_len=convert_to_byte(args.cache)/pow(1024, 3) #In gigabytes else: args.max_cache_len=0 +if args.max_cache_len == 0: + args.use_cacher = False if args.gpu_cache is not None: args.max_gpu_cache_len=convert_to_byte(args.gpu_cache)/pow(1024, 3) #In gigabytes else: From 1be9fb734b8cb94c0acffc971e30b0e11a049e9e Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Mon, 13 Jan 2025 00:16:26 -0500 Subject: [PATCH 2/8] doc: performance test result --- PerformanceTest.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 PerformanceTest.md diff --git a/PerformanceTest.md b/PerformanceTest.md new file mode 100644 index 0000000..176d189 --- /dev/null +++ b/PerformanceTest.md @@ -0,0 +1,87 @@ +# To Know +基于Release版本v0.3, 测试平台为windows10 22H2, CPU Intel 10400f , GPU Nvidia 3060 12G,Nvidia 1660 Super 6G, ARC A770 16G, RX580 8G. +Jpeg compression 和 Input Simplify 都 medium, debug input 不使用eyebrow参数, 帧数限制60fps +观察开始后约5-10秒的数值记录,不考虑长期缓存效果(没时间测) + +GPU | model | VRAM Cache | RAM Cache | Interpolation | SR | Frame Rate | GPU Usage +:---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: +A770 | sepe_half | N/A | No | No | No | 33fps | 97% +A770 | sepe_full | N/A | No | No | No | 48fps | 97% +A770 | stan_half | N/A | No | No | No | 27fps | 97% +A770 | stan_full | N/A | No | No | No | 29fps | 97% +A770 | sepe_half | N/A | 2GB | No | No | 30fps | 82% +A770 | sepe_full | N/A | 2GB | No | No | 43fps | 78% +A770 | stan_half | N/A | 2GB | No | No | 30fps | 82% +A770 | stan_full | N/A | 2GB | No | No | 23fps | 85% +A770 | sepe_full | N/A | No | No | x2_half | 17fps | 97% +A770 | sepe_full | N/A | No | No | x4_half | 29fps | 97% +A770 | sepe_full | N/A | No | No | x4_full | 25fps | 93% +A770 | sepe_full | N/A | No | x2_half | No | 60fps | 93% +A770 | sepe_full | N/A | No | x3_half | No | 60fps | 85% +A770 | sepe_full | N/A | No | x4_half | No | 60fps | 81% +-- | -- | --| --|--|--|--|-- +RX580 | sepe_full | N/A | No | No | No | 12fps | 98% +RX580 | stan_full | N/A | No | No | No | 15fps | 98% +RX580 | sepe_full | N/A | 2GB | No | No | 11fps | 93% +RX580 | stan_full | N/A | 2GB | No | No | 13fps | 93% +RX580 | stan_full | N/A | No | No | x2_half | 10fps | 97% +RX580 | stan_full | N/A | No | No | x2_full | 10fps | 97% +RX580 | stan_full | N/A | No | No | x4_half | 11fps | 98% +RX580 | stan_full | N/A | No | No | x4_full | 11fps | 98% +RX580 | stan_full | N/A | No | x2_half | no | 22fps | 98% +RX580 | stan_full | N/A | No | x2_full | no | 22fps | 98% +RX580 | stan_full | N/A | No | x3_half | no | 28fps | 98% +RX580 | stan_full | N/A | No | x3_full | no | 28fps | 98% +RX580 | stan_full | N/A | No | x4_half | no | 33fps | 98% +RX580 | stan_full | N/A | No | x4_full | no | 33fps | 98% +-- | -- | --| --|--|--|--|-- +1660s | sepe_half | No | No | No | No | 38fps | 95% +1660s | sepe_full | No | No | No | No | 28fps | 95% +1660s | stan_half | No | No | No | No | 21fps | 96% +1660s | stan_full | No | No | No | No | 12fps | 98% +1660s | sepe_half | 2GB | No | No | No | 39fps | 95% +1660s | sepe_full | 2GB | No | No | No | 28fps | 95% +1660s | stan_half | 2GB | No | No | No | 29fps | 96% +1660s | stan_full | 2GB | No | No | No | 12fps | 96% +1660s | sepe_half | 2GB | 2GB | No | No | 40fps | 75% +1660s | sepe_full | 2GB | 2GB | No | No | 24fps | 80% +1660s | stan_half | 2GB | 2GB | No | No | 26fps | 83% +1660s | stan_full | 2GB | 2GB | No | No | 12fps | 92% +1660s | sepe_half | No | No | No | x2_half | 23fps | 96% +1660s | sepe_half | No | No | No | x2_full | 18fps | 96% +1660s | sepe_half | No | No | No | x4_half | 23fps | 96% +1660s | sepe_half | No | No | No | x4_full | 26fps | 97% +1660s | sepe_half | No | No | x2_half | No | 63fps | 75% +1660s | sepe_half | No | No | x2_full | No | 63fps | 80% +1660s | sepe_half | No | No | x3_half | No | 63fps | 65% +1660s | sepe_half | No | No | x3_full | No | 64fps | 66% +1660s | sepe_half | No | No | x4_half | No | 64fps | 53% +1660s | sepe_half | No | No | x4_full | No | 64fps | 60% +-- | -- | --| --|--|--|--|-- +3060 | sepe_half | No | No | No | No | 63fps | 62% +3060 | sepe_full | No | No | No | No | 59fps | 93% +3060 | stan_half | No | No | No | No | 63fps | 80% +3060 | stan_full | No | No | No | No | 31fps | 96% +3060 | sepe_half | 2GB | No | No | No | 63fps | 60% +3060 | sepe_full | 2GB | No | No | No | 60fps | 93% +3060 | stan_half | 2GB | No | No | No | 63fps | 76% +3060 | stan_full | 2GB | No | No | No | 33fps | 96% +3060 | sepe_half | 2GB | 2GB | No | No | 63fps | 58% +3060 | sepe_full | 2GB | 2GB | No | No | 46fps | 70% +3060 | stan_half | 2GB | 2GB | No | No | 43fps | 62% +3060 | stan_full | 2GB | 2GB | No | No | 27fps | 80% +3060 | sepe_half | No | No | No | x2_half | 53fps | 85% +3060 | sepe_half | No | No | No | x2_full | 30fps | 94% +3060 | sepe_half | No | No | No | x4_half | 49fps | 90% +3060 | sepe_half | No | No | No | x4_full | 45fps | 90% +3060 | sepe_half | No | No | x2_half | No | 64fps | 45% +3060 | sepe_half | No | No | x2_full | No | 63fps | 50% +3060 | sepe_half | No | No | x3_half | No | 64fps | 35% +3060 | sepe_half | No | No | x3_full | No | 64fps | 42% +3060 | sepe_half | No | No | x4_half | No | 64fps | 30% +3060 | sepe_half | No | No | x4_full | No | 64fps | 40% + +DirectML问题: +* A770: rife插帧全精度会出现奇怪结果, waifu2x 全精度会输出全绿色 +* RX580 tha3 模型半精度会输出奇怪结果 +* 3060 有时出现奇怪运行时占用上升,猜测驱动问题。 \ No newline at end of file diff --git a/README.md b/README.md index 5ea1cb4..c67c63f 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,14 @@ Updates: * 使用 [TurboJPEG](https://github.com/Dobatymo/turbojpeg-python) 获得成倍缓存命中率提升,在长时间使用上显卡减负效果相当出色。 * 使用 [waifu2x](https://github.com/nagadomi/waifu2x) 和 [real-esrgan]() 项目带来的输出超分辨率,对比anime4k效果提升显著(也使用更多gpu占用) * 更漂亮的 WxPython 新启动器界面,带中文介绍更加简单易用 +* 添加Spout2 支持输出原生透明通道给OBS ## Requirements ### 硬件 - 支持FaceID的iPhone(使用ifacialmocap软件,需购买,需要稳定的WIFI连接)或网络摄像头(使用OpenCV) -- 任意5年内的游戏级显卡,N卡/A卡/I卡均可使用 +- 任意5年内的游戏级显卡,N卡/A卡/I卡均可使用, 请参考[性能测试结果](PerformanceTest.md) ### 软件 - 本方案在Windows 10上测试可用 From 2dc83c3d2ec0efe1407c39a71ad3fe241e897c74 Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Mon, 13 Jan 2025 23:47:03 -0500 Subject: [PATCH 3/8] fix: cacher size control bug --- ezvtuber-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ezvtuber-rt b/ezvtuber-rt index 09de205..0df623d 160000 --- a/ezvtuber-rt +++ b/ezvtuber-rt @@ -1 +1 @@ -Subproject commit 09de205f3b5b53e984689d78a22b805a2592d18c +Subproject commit 0df623dbea82711fbbda1a11bce5889e8233f866 From b2d41c2d63cc08fd6532df7d872bd054bd39c6e4 Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Tue, 14 Jan 2025 02:08:34 -0500 Subject: [PATCH 4/8] fix: launcher interpolation Off bug and cacher bottleneck --- ezvtuber-rt | 2 +- launcher2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ezvtuber-rt b/ezvtuber-rt index 0df623d..cafa944 160000 --- a/ezvtuber-rt +++ b/ezvtuber-rt @@ -1 +1 @@ -Subproject commit 0df623dbea82711fbbda1a11bce5889e8233f866 +Subproject commit cafa944d8bea51104fe7806c95f60463ab0b80a6 diff --git a/launcher2.py b/launcher2.py index 3505854..3e24dcd 100644 --- a/launcher2.py +++ b/launcher2.py @@ -388,7 +388,7 @@ class LauncherPanel(wx.Panel): run_args.append(args['vram_cache_size']) if args['interpolation'] is not None: - if not 'off' == args['interpolation']: + if not 'Off' == args['interpolation']: run_args.append('--use_interpolation') if 'half' in args['interpolation']: run_args.append('--interpolation_half') From d4110ec8df5d89d35ed6695546d5705f0f7111db Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Tue, 14 Jan 2025 02:22:16 -0500 Subject: [PATCH 5/8] fix: launcher interpolation Off bug and cacher bottleneck --- ezvtuber-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ezvtuber-rt b/ezvtuber-rt index cafa944..2c3f7a9 160000 --- a/ezvtuber-rt +++ b/ezvtuber-rt @@ -1 +1 @@ -Subproject commit cafa944d8bea51104fe7806c95f60463ab0b80a6 +Subproject commit 2c3f7a98ff07335cc4c8e84f3c21afd72f7726ba From 3e87289c8d24ab3354e97964cb8556e5799db5fa Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Tue, 14 Jan 2025 02:31:27 -0500 Subject: [PATCH 6/8] fix: launcher interpolation Off bug and cacher bottleneck --- ezvtuber-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ezvtuber-rt b/ezvtuber-rt index 2c3f7a9..4ee9e63 160000 --- a/ezvtuber-rt +++ b/ezvtuber-rt @@ -1 +1 @@ -Subproject commit 2c3f7a98ff07335cc4c8e84f3c21afd72f7726ba +Subproject commit 4ee9e63d962bacbc5640194fbe90660e8c19824d From 3c0bc508a8657f25bb3de8d011d7447acc77c25f Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Tue, 14 Jan 2025 22:34:00 -0500 Subject: [PATCH 7/8] feat: solved cudatoolkit requirements and updated documents --- 00.检查安装CudaToolkits.bat | 12 -------- 00A.英伟达CudaToolkits.url | 5 ---- 00E.OBS透明通道-StreamFX.url | 5 ---- 00F.OBS透明通道-着色器文件.url | 5 ---- 01A.构建运行环境(默认源).bat | 1 + 01B.构建运行环境(国内源).bat | 1 + PerformanceTest.md | 50 +++++++++++++++++++++++++++++----- README.md | 34 +++++------------------ 8 files changed, 52 insertions(+), 61 deletions(-) delete mode 100644 00.检查安装CudaToolkits.bat delete mode 100644 00A.英伟达CudaToolkits.url delete mode 100644 00E.OBS透明通道-StreamFX.url delete mode 100644 00F.OBS透明通道-着色器文件.url diff --git a/00.检查安装CudaToolkits.bat b/00.检查安装CudaToolkits.bat deleted file mode 100644 index 51e6973..0000000 --- a/00.检查安装CudaToolkits.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off - -WHERE nvidia-smi -IF %ERRORLEVEL% NEQ 0 ( - echo 'CudaTookit No Ready!!!! Please install manually' -) else ( - echo 'CudaTookit Ready, go ahead next step' -) -echo. -echo. -echo Make sure everything is OK before you run 01A or 01B. -pause \ No newline at end of file diff --git a/00A.英伟达CudaToolkits.url b/00A.英伟达CudaToolkits.url deleted file mode 100644 index 4cc81d2..0000000 --- a/00A.英伟达CudaToolkits.url +++ /dev/null @@ -1,5 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -[InternetShortcut] -IDList= -URL=https://developer.nvidia.com/cuda-downloads diff --git a/00E.OBS透明通道-StreamFX.url b/00E.OBS透明通道-StreamFX.url deleted file mode 100644 index e44cc72..0000000 --- a/00E.OBS透明通道-StreamFX.url +++ /dev/null @@ -1,5 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -[InternetShortcut] -IDList= -URL=https://github.com/Xaymar/obs-StreamFX diff --git a/00F.OBS透明通道-着色器文件.url b/00F.OBS透明通道-着色器文件.url deleted file mode 100644 index cc8014f..0000000 --- a/00F.OBS透明通道-着色器文件.url +++ /dev/null @@ -1,5 +0,0 @@ -[{000214A0-0000-0000-C000-000000000046}] -Prop3=19,11 -[InternetShortcut] -IDList= -URL=https://github.com/shugen002/shader/blob/master/merge%20alpha2.hlsl diff --git a/01A.构建运行环境(默认源).bat b/01A.构建运行环境(默认源).bat index 0837ecb..4e6fba0 100644 --- a/01A.构建运行环境(默认源).bat +++ b/01A.构建运行环境(默认源).bat @@ -28,6 +28,7 @@ call conda create -y -n ezvtb_rt_venv python=3.10 call conda activate ezvtb_rt_venv call conda env list +call conda install -y nvidia/label/cuda-12.6.3::cuda-nvcc-dev_win-64 call conda install -y conda-forge::pycuda call python -m pip install --upgrade pip wheel diff --git a/01B.构建运行环境(国内源).bat b/01B.构建运行环境(国内源).bat index 7a0eedc..1e20ea1 100644 --- a/01B.构建运行环境(国内源).bat +++ b/01B.构建运行环境(国内源).bat @@ -28,6 +28,7 @@ call conda create -y -n ezvtb_rt_venv python=3.10 call conda activate ezvtb_rt_venv call conda env list +call conda install -y nvidia/label/cuda-12.6.3::cuda-nvcc-dev_win-64 call conda install -y pycuda -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ call python -m pip install --upgrade pip wheel -i https://mirrors.aliyun.com/pypi/simple/ diff --git a/PerformanceTest.md b/PerformanceTest.md index 176d189..1d048ea 100644 --- a/PerformanceTest.md +++ b/PerformanceTest.md @@ -1,7 +1,21 @@ -# To Know -基于Release版本v0.3, 测试平台为windows10 22H2, CPU Intel 10400f , GPU Nvidia 3060 12G,Nvidia 1660 Super 6G, ARC A770 16G, RX580 8G. -Jpeg compression 和 Input Simplify 都 medium, debug input 不使用eyebrow参数, 帧数限制60fps -观察开始后约5-10秒的数值记录,不考虑长期缓存效果(没时间测) +# 测试环境 +### 基于 +* Release版本v0.3 +* 测试平台为windows10 22H2 +* CPU Intel 10400f +* GPU Nvidia 3060 12G, Nvidia 1660 Super 6G, ARC A770 16G,RX580 8G. + +### 测试定量 +* Jpeg compression 和 Input Simplify 设为 medium +* 使用debug input 和 debug output +* 不使用eyebrow参数 +* 帧数限制60fps +* 英伟达显卡使用TensorRT测试 + +观察开始后约5-10秒的数值记录, 即不考虑长期缓存效果(没时间测) + +# 测试结果 +请注意测试结果仅限参考显卡大概性能,具体性能取决于用户周边配置和显卡驱动。 GPU | model | VRAM Cache | RAM Cache | Interpolation | SR | Frame Rate | GPU Usage :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: @@ -81,7 +95,29 @@ RX580 | stan_full | N/A | No | x4_full | no | 33fps | 98% 3060 | sepe_half | No | No | x4_half | No | 64fps | 30% 3060 | sepe_half | No | No | x4_full | No | 64fps | 40% -DirectML问题: -* A770: rife插帧全精度会出现奇怪结果, waifu2x 全精度会输出全绿色 +# 已知问题: +* A770: rife插帧全精度会出现奇怪结果, waifu2x 超分的全精度会输出全绿色 * RX580 tha3 模型半精度会输出奇怪结果 -* 3060 有时出现奇怪运行时占用上升,猜测驱动问题。 \ No newline at end of file +* 3060 有时出现奇怪运行时占用上升,猜测为插拔显卡导致的驱动问题。 + +# DirectML 思考 +DirectML 允许所有 Windows 显卡设备以及 AIPC 的 NPU 运行此项目,但由于不同设备的 Kernel 在不同精度下实现区别和驱动兼容问题, +导致 DirectML 的运行结果在某个模型的某些精度出现不可用的扭曲结果,且运行性能与对模型的常识理解不相符。 + +例如适用于本项目插帧的RIFE模型的调用封装经历过一轮迭代, +由原先的n次输入(N=1,C,H,W)独立图像调用RIFE模型生成n个独立结果, +改为输入(N=n,C,H,W)的叠加图像一次性调用RIFE模型得到叠加结果, +此改动下模型获得了稍小的显存占用且在TensorRT实现中获得一定性能提升(虽然改动本意并不在此)。 +接着在笔者环境中的因特尔 A770 显卡 DirectML 在RIFE模型迭代后全精度推理结果由原先的符合预期变为扭曲图像, +半精度迭代后模型不仅保持推理结果符合预期,且相较模型迭代前得到了一定性能提升。 + +再例如笔者测试某 AMD 核显运行时发现其运行THA3的半精度模型时会因为此设备无法运行其中的某个kernel而将kernel运算单独卸载到cpu进行, +但保留了其他大部分能在核显上运行的kernel,由此推理模型需要结果在两个设备间反复,带来了极大的性能倒退。 + +目前阶段,受限于Python OnnxRuntime api 的支持匮乏(相较C++),使用 python 运行 Directml 无法避免上述问题, +在代码层面无法在运行前做出是否适配的条件判断,也无法在出现kernel卸载到cpu性能剧降时raise错误将运行打断。 + +所以,DirectML运行本项目的任意模型出现奇怪结果,或不符合预期的性能倒退,都应该属于意料之中 +换个模型精度,观察调试输出是否有DirectML黄字警告 通常可以解决大部分问题。 +具体某个硬件在DirectML的运行异常修复,已远超本项目的目标范围,请自行验证失效kernel,向硬件厂商和微软求助并期待驱动更新带来解决 +(建议买张N卡吧别折腾自己了)。 diff --git a/README.md b/README.md index cb0e488..a3b5d57 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Updates: ### 硬件 - 支持FaceID的iPhone(使用ifacialmocap软件,需购买,需要稳定的WIFI连接)或网络摄像头(使用OpenCV) -- 任意5年内的游戏级显卡,N卡/A卡/I卡均可使用, 请参考[性能测试结果](PerformanceTest.md) +- 任意5年内的游戏级显卡,N卡/A卡/I卡均可使用,某些新款APU的NPU同样可以,请参考[性能测试结果](PerformanceTest.md) ### 软件 - 本方案在Windows 10上测试可用 @@ -74,41 +74,20 @@ Start testing if TensorRT works on this machine ``` ### 启动项目 -双击`02A.启动器.bat` 或 `02B.启动器(调试输出).bat` 启动器,如下图启动: +双击`02A.启动器.bat` 或 `02B.启动器(调试输出).bat` 启动器,如下图启动(可在上一步构建同时启动,将TensorRT去除勾选即可): ![](assets/02success.png) 之后请移步输入输出自行调节。 ## Installation(科学上网且使用Git) 可使用此安装方法对本项目二次开发 -### 下载并安装CUDAToolkit -前往 [英伟达官网](https://developer.nvidia.com/cuda-downloads) 下载并安装`CUDATookit 12`及以上版本。 -若安装成功并重启可开启命令行工具验证出现类似如下结果: -``` -C:\Users\Eleven>nvidia-smi -Thu Jan 9 22:02:29 2025 -+-----------------------------------------------------------------------------------------+ -| NVIDIA-SMI 556.12 Driver Version: 556.12 CUDA Version: 12.5 | -|-----------------------------------------+------------------------+----------------------+ -| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC | -| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | -| | | MIG M. | -|=========================================+========================+======================| -| 0 NVIDIA GeForce GTX 1660 ... WDDM | 00000000:01:00.0 On | N/A | -| 32% 34C P8 10W / 125W | 569MiB / 6144MiB | 1% Default | -| | | N/A | -+-----------------------------------------+------------------------+----------------------+ -........ -``` -或可以双击 `00.检查安装CudaToolkits.bat` 来验证 - ### 安装Anaconda(可选) 前往https://www.anaconda.com/ 安装Anaconda 并保证加入环境变量命令行可以找到,如: ``` C:\Users\Eleven>conda --version conda 24.11.3 ``` -以上方式可以保证conda环境被你选定的Ananconda统一管理。若没有此需求可以忽略直接运行下一步,脚本会自动安装miniconda。 +以上方式可以保证conda环境被你选定的Ananconda统一管理。若没有此需求可以忽略直接运行下一步,`01X.构建运行环境(XX源).bat`脚本会自动安装miniconda。 ### 克隆项目和子项目 ``` @@ -119,12 +98,13 @@ git submodule update --recursive --remote ``` ### 安装环境 -双击运行`01A.构建运行环境(默认源).bat`或者`01B.构建运行环境(国内源).bat` +根据网络环境双击运行`01A.构建运行环境(默认源).bat`或者`01B.构建运行环境(国内源).bat` 这两个脚本会构建名为`ezvtb_rt_venv`的conda环境 或可以用如下命令手动创建: ``` conda create -y -n ezvtb_rt_venv python=3.10 conda activate ezvtb_rt_venv +call conda install -y nvidia/label/cuda-12.6.3::cuda-nvcc-dev_win-64 conda install -y conda-forge::pycuda python -m pip install --upgrade pip wheel python -m pip install nvidia-cudnn-cu12 @@ -147,9 +127,9 @@ python -m pip install -r requirements.txt --no-warn-script-location ### 运行启动器 在Conda环境中执行以下命令 -`python launcher.py` +`python launcher2.py` -### 错误排查 +### 环境错误排查 当运行TensorRT构建或启动器出现错误时,请参考如下可能性: 1. 环境安装有错误(一般运行时缺少库99%的原因都是这个,pip下载并不稳定,各种网络问题都可能导致安装失败),检查源,手动删除`envs`文件夹再试, 对照 [此log](assets/complete_building_log.txt) 为成功案例排查原因。 实在不懂排查请使用整合包。 2. nvcc编译器没找到,即CudaToolkit安装有误,双击 `00.检查安装CudaToolkits.bat` 来验证 From e226bdb56441694f6524336da61eea629cf0137e Mon Sep 17 00:00:00 2001 From: zpeng11 Date: Wed, 15 Jan 2025 01:19:16 -0500 Subject: [PATCH 8/8] Multi GPU support and Readme update --- README.md | 9 ++++----- launcher2.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a3b5d57..8c4003c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Updates: * 为A卡和I卡提供DirectML支持,人人都能玩。 * 引入[RIFE](https://github.com/hzwer/ECCV2022-RIFE)模型进行插帧,极限帧数提升达到50%-100%,配合锁帧可以有效降低使用占用。 * 使用 [TurboJPEG](https://github.com/Dobatymo/turbojpeg-python) 获得成倍缓存命中率提升,在长时间使用上显卡减负效果相当出色。 -* 使用 [waifu2x](https://github.com/nagadomi/waifu2x) 和 [real-esrgan]() 项目带来的输出超分辨率,对比anime4k效果提升显著(也使用更多gpu占用) +* 使用 [waifu2x](https://github.com/nagadomi/waifu2x) 和 [real-esrgan](https://github.com/xinntao/Real-ESRGAN) 项目带来的输出超分辨率,对比anime4k效果提升显著(也使用更多gpu占用) * 更漂亮的 WxPython 新启动器界面,带中文介绍更加简单易用 * 添加Spout2 支持输出原生透明通道给OBS @@ -25,7 +25,7 @@ Updates: ### 硬件 - 支持FaceID的iPhone(使用ifacialmocap软件,需购买,需要稳定的WIFI连接)或网络摄像头(使用OpenCV) -- 任意5年内的游戏级显卡,N卡/A卡/I卡均可使用,某些新款APU的NPU同样可以,请参考[性能测试结果](PerformanceTest.md) +- 任意5年内的游戏级显卡,N卡/A卡/I卡均可使用,某些性能强的核显也可尝试,请参考[性能测试结果](PerformanceTest.md) ### 软件 - 本方案在Windows 10上测试可用 @@ -132,8 +132,7 @@ python -m pip install -r requirements.txt --no-warn-script-location ### 环境错误排查 当运行TensorRT构建或启动器出现错误时,请参考如下可能性: 1. 环境安装有错误(一般运行时缺少库99%的原因都是这个,pip下载并不稳定,各种网络问题都可能导致安装失败),检查源,手动删除`envs`文件夹再试, 对照 [此log](assets/complete_building_log.txt) 为成功案例排查原因。 实在不懂排查请使用整合包。 -2. nvcc编译器没找到,即CudaToolkit安装有误,双击 `00.检查安装CudaToolkits.bat` 来验证 -3. 英伟达显卡但计算架构低于7.5(10系以及之前)不支持TensorRT +2. 英伟达显卡但计算架构低于7.5(10系以及之前)不支持TensorRT ## 输入输出设备 #### SPOUT2 OBS插件输出 @@ -173,7 +172,7 @@ https://www.ifacialmocap.com/download/ #### OpenSeeFace https://github.com/emilianavt/OpenSeeFace/releases -直接下载最新版本的Release包并解压 +直接下载最新版本的Release包并解压,或使用整合包附带的压缩包 之后进入解压目录的Binary文件夹 右键编辑`run.bat`,在倒数第二行运行facetracker的命令后加上`--model 4`,切换到模型4可以wink `facetracker -c %cameraNum% -F %fps% -D %dcaps% -v 3 -P 1 --discard-after 0 --scan-every 0 --no-3d-adapt 1 --max-feature-updates 900 --model 4`(仅供参考) diff --git a/launcher2.py b/launcher2.py index 3e24dcd..ea6fac8 100644 --- a/launcher2.py +++ b/launcher2.py @@ -206,7 +206,7 @@ class LauncherPanel(wx.Panel): choices=['Spout2', 'OBS VirtualCam', 'UnityCapture', 'Debug Output'], mapping=[3, 1, 0, 2]) - addOption('device_id', title='GPU Device', desc='选择需要使用的计算设备', choices=['0']) + addOption('device_id', title='GPU Device', desc='选择需要使用的计算设备(默认0)', choices=['0','1','2','3']) addOption('use_tensorrt', title='TensorRT', desc='开启TensorRT后可使用预编译模型\n进一步提升性能(仅NVIDIA显卡支持)', type=1)