maxos 2023-01-02 13:13 采纳率: 33.3%
浏览 226
已结题

UE5.1使用VS2022Pro编译时,为什么VS2022只使用单线程编译?

我的CPU是 i7-6700k,4 核 8 线程,用 VS2022Pro 编译 UE5.1 时,为什么VS2022只使用单线程编译?

已启动编译
1>------ 已启动编译: 项目: UE5, 配置: Development_Editor x64 ------
1>Using bundled DotNet SDK version: 6.0.302
1>Running UnrealBuildTool: dotnet ".\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -Target="UnrealEditor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild
1>Log file: D:\UnrealEngine-5.1\Engine\Programs\UnrealBuildTool\Log.txt
1>Building UnrealEditor and ShaderCompileWorker.
1>Using Visual Studio 2022 14.31.31104 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.31.31103) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
1>  Executing up to 4 processes, one per physical core
1>  Requested 1.5 GB free memory per action, 1.12 GB available: limiting max parallel actions to 1
1>Building 5394 actions with 1 process.
1>[1/5394] Compile Module.Core.4_of_19.cpp
1>[2/5394] Compile Module.Core.2_of_19.cpp
1>[3/5394] Copy AnimEncoding_VariableKeyLerp.ispc.generated.h
1>[4/5394] Compile Module.Core.12_of_19.cpp

如上,输出窗口提示了:Building 5394 actions with 1 process.
但是根据我的CPU核心数量,它应该是使用 8 线程编译才对。

我尝试修改 UnrealEngine-5.1\Engine\Saved\UnrealBuildTool\BuildConfiguration.xml,
改成如下内容:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <BuildConfiguration>
        <bAllowFASTBuild>false</bAllowFASTBuild>
        <bUseXGEController>false</bUseXGEController>
        <bAllowXGE>false</bAllowXGE>
    </BuildConfiguration>
    <LocalExecutor>
        <MaxProcessorCount>8</MaxProcessorCount>
        <ProcessorCountMultiplier>1</ProcessorCountMultiplier>
    </LocalExecutor>
</Configuration>

也是不起作用的,还是 1 个线程在编译。
我再将上面的 LocalExecutor 改为 ParallelExecutor,
仍然不行,依旧是 1 个线程在编译。
有人知道怎么让它以 8 线程编译吗?
非常感谢。

  • 写回答

3条回答 默认 最新

  • |__WhoAmI__| 2023-01-02 16:30
    关注

    看起来像是 UnrealBuildTool 在判断最大并行构建数量时,可能没有正确地读取可用内存数。它可能将最大并行构建数量限制为 1,因为它认为没有足够的内存。

    可以试试在 BuildConfiguration.xml 文件中更改以下内容:

    <LocalExecutor>
        <MinFreeMemoryMb>0</MinFreeMemoryMb>
        <MinFreeMemoryPercentage>0</MinFreeMemoryPercentage>
    </LocalExecutor>
    

    这样UnrealBuildTool 将不会考虑可用内存数,并使用 CPU 的所有核心进行构建。

    另外也可以在命令行中使用 -j 参数来指定最大并行构建数量。例如可以使用以下命令行来使用 8 个线程进行构建:

    UnrealBuildTool -j8
    

    注意在使用较大的并行构建数量时,可能会出现系统内存不足的情况。可能需要调整系统中的其他设置,以便在构建过程中更多的内存可供使用。
    仅供参考,望采纳,谢谢。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 1月4日
  • 已采纳回答 1月4日
  • 修改了问题 1月2日
  • 修改了问题 1月2日
  • 展开全部

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置