Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error on win11 #1787

Open
TenYac opened this issue Feb 4, 2024 · 3 comments
Open

Compile error on win11 #1787

TenYac opened this issue Feb 4, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TenYac
Copy link

TenYac commented Feb 4, 2024

Describe the bug (both Chinese and English are OK)

visual studio2022编译报错

output窗口输出:
D:\10yac_workspace2\zeno\build\projects\CUDA\zpc\include\zensim>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin\nvcc.exe" -dlink -o zs_cu_wrangler.dir\Release\zs_cu_wrangler.device-link.obj -Xcompiler "/EHsc /W1 /nologo /O2 /MD /GR" -Xcompiler "/Fdzs_cu_wrangler.dir\Release\zs_cu_wrangler.pdb" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin/crt" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\lib\x64" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib cudart.lib cudadevrt.lib -gencode=arch=compute_89,code=sm_89 zs_cu_wrangler.dir\Release\ParticleWrangler.ptx
67>cl : 命令行 warning D9025: 正在重写“/W1”(用“/w”)
67>cl : 命令行 warning D9025: 正在重写“/W1”(用“/w”)
67>cl : 命令行 warning D9025: 正在重写“/W1”(用“/w”)
65>StringReadUtil.cpp
67>cl : 命令行 warning D9025: 正在重写“/W1”(用“/w”)
68>cl : 命令行 warning D9025: 正在重写“/W1”(用“/w”)
66>kernel32.lib
66>user32.lib
66>gdi32.lib
65>StringWriteUtil.cpp
66>winspool.lib
66>comdlg32.lib
66>advapi32.lib
66>shell32.lib
66>ole32.lib
66>oleaut32.lib
66>uuid.lib
66>odbc32.lib
66>odbccp32.lib
66>cudart.lib
66>cudadevrt.lib
66>ParticleWrangler.ptx
66>CUDALINK : nvlink error : Undefined reference to '_Z16zfx_wrangle_funcPfPKf' in 'C:/Users/10yac/AppData/Local/Temp/tmpxft_00002d58_00000000-10_ParticleWrangler.obj'
66>d:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.3.targets(908,9): error MSB3721: 命令“"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin\nvcc.exe" -dlink -o zs_cu_wrangler.dir\Release\zs_cu_wrangler.device-link.obj -Xcompiler "/EHsc /W1 /nologo /O2 /MD /GR" -Xcompiler "/Fdzs_cu_wrangler.dir\Release\zs_cu_wrangler.pdb" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin/crt" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\lib\x64" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib cudart.lib cudadevrt.lib -gencode=arch=compute_89,code=sm_89 zs_cu_wrangler.dir\Release\ParticleWrangler.ptx”已退出,返回代码为 255。
66>已完成生成项目“zs_cu_wrangler.vcxproj”的操作 - 失败。

How To Reproduce

Please concisely describe the steps before you encounter the bug, e.g.:

  1. Cmake:

cmake -B build -DCMAKE_BUILD_TYPE=Release -DQt5_DIR="C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5" -DCMAKE_TOOLCHAIN_FILE="D:/10yac_workspace/vcpkg/scripts/buildsystems/vcpkg.cmake" -DZENO_WITH_CUDA:BOOL=ON -DZENO_WITH_ZenoFX:BOOL=ON -DZENO_ENABLE_OPTIX:BOOL=ON -DZENO_SYSTEM_OPENVDB:BOOL=OFF -DZENOFX_ENABLE_OPENVDB:BOOL=ON -DZENOFX_ENABLE_LBVH:BOOL=ON -DZENO_WITH_zenvdb:BOOL=ON -DZENO_WITH_FastFLIP:BOOL=ON -DZENO_WITH_FEM:BOOL=ON -DZENO_WITH_Rigid:BOOL=ON -DZENO_WITH_cgmesh:BOOL=ON -DZENO_WITH_oldzenbase:BOOL=ON -DZENO_WITH_TreeSketch:BOOL=ON -DZENO_WITH_Skinning:BOOL=ON -DZENO_WITH_Euler:BOOL=ON -DZENO_WITH_Functional:BOOL=ON -DZENO_WITH_LSystem:BOOL=ON -DZENO_WITH_mesher:BOOL=ON -DZENO_WITH_Alembic:BOOL=ON -DZENO_WITH_FBX:BOOL=ON -DZENO_WITH_DemBones:BOOL=ON -DZENO_WITH_SampleModel:BOOL=ON -DZENO_WITH_CalcGeometryUV:BOOL=ON -DZENO_WITH_MeshSubdiv:BOOL=ON -DZENO_WITH_Audio:BOOL=ON -DZENO_WITH_PBD:BOOL=ON -DZENO_WITH_GUI:BOOL=ON -DZENO_WITH_ImgCV:BOOL=ON -DZENO_WITH_TOOL_FLIPtools:BOOL=ON -DZENO_WITH_TOOL_cgmeshTools:BOOL=ON -DZENO_WITH_TOOL_BulletTools:BOOL=ON -DZENO_WITH_TOOL_HerculesTools:BOOL=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

  1. 由于编译zs_cu_wrangler模块之前会报错'ptxas fatal : SM version specified by .target is higher than default SM version assumed', 所以我尝试在zs_cu_wrangler的项目属性的CUDA C/C++ -> Device -> Code Generation中填入了compute_89,sm_89
  2. 如果cmake的ZENO_WITH_CUDA设置为OFF可以编译成功
  3. 最新的子模块zpc也可以单独编译成功

Environment

  • System: Windows 11
  • Zeno Version: 提交哈希(af4e177), 最新的release版本(76da4ff)也尝试过, 不过由于这个版本的zpc模块没有修复该问题(Compile Error on Win11 zpc#5), 所以我尝试暂时注释掉了ZpcIterator.hpp中的

&& is_same_v<decltype(declval<Iter &>() + declval<diff_t>()), Iter>
&& is_same_v<decltype(declval<diff_t>() + declval<Iter &>()), Iter>

        虽然这让zpc模块能够成功通过编译, 不过也会出现上述的nvlink error问题.

  • Graphics card (for viewport bugs): GTX 4090 驱动版本546.33, CUDA Toolkit 12.3
@TenYac TenYac added the bug Something isn't working label Feb 4, 2024
@teachmain
Copy link
Collaborator

@littlemine

@littlemine
Copy link
Collaborator

月初调整了下cuda模块构建时architecture设置的逻辑,请问现在问题解决了吗

@TenYac
Copy link
Author

TenYac commented May 10, 2024

有对应的提交版本吗? 我拉下来试一下.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants