Giter Site home page Giter Site logo

zpc's Introduction

Zenus Simulation

Zenus Simulation is the codebase zensim maintained by Zenus Tech, which delivers great parallel computing efficiency for physics-based simulations within a shared-memory heterogeneous architecture through a unified programming interface on multiple compute backends.

This repo is going through rapid changes, and we do not promise ABI compatibility from commit to commit for the moment.

Document

See git wiki page for more build details. See Specification for more usage info.

Compilation

This is a cross-platform C++/CUDA cmake project. The minimum version requirement of cmake is 3.18, yet the latest version is generally recommended. Please install cmake through official website or python3-pip, since the cmake version in apt repo is behind.

When CUDA is enabled, the required CUDA version is 11.4+ (for c++17 and latest cuda utilities).

Currently, supported OS are Ubuntu 20.04+ and Windows 10, and tested compilers includes gcc10.0+, clang-11+, vs2019+.

Build

Before building this framework, please first manually configure these external dependencies, i.e. openvdb if ZS_ENABLE_OPENVDB is set to TRUE. Then pull all dependencies by

git submodule init
git submodule update

If CUDA (>=11.4) is installed and required, be sure to set ZS_ENABLE_CUDA=On first.

Configure the project using the CMake Tools extension in Visual Studio Code (recommended), or follow the build instructions in git wiki.

In addition, make sure to install zlib for building partio when building on linux.

sudo apt install zlib1g

Integration

Directly include the codebase as a submodule. Or install this repo then use find_package(zensim). If the installed package is no longer needed, build the uninstall target as with the install target.

Credits

This framework draws inspirations from Taichi, kokkos, raja, MGMPM, GPU LBVH.

Dependencies

The following libraries are adopted and made fully localized in our project development:

For spatial data IO and generation, we use these libraries in addition:

We import these (less-frequently used) libraries as well:

zpc's People

Contributors

littlemine avatar dwxrycb123 avatar seeeagull avatar shulianglu avatar archibate avatar kaiyang-1 avatar zhxx1987 avatar lsltql avatar aaronmack avatar ailon-island avatar

Stargazers

ABE avatar ysy avatar Zu Wang avatar 星吧唧 avatar ARessegetes Stery avatar Jensen Inequality avatar Siwei He avatar Housz avatar  avatar Shi Yihao avatar Nobuyuki Umetani avatar Lieλ avatar Luo Siyuan avatar ElonKou avatar XuWANG avatar  avatar szlent avatar  avatar Vicky Lu avatar CLV-Iclucia avatar MuGdxy avatar Asher avatar Ruan Liangwang avatar Hoildkv avatar Cyclone avatar  avatar Zike Xu avatar  avatar Siyan avatar Ling Zhan avatar  avatar Minchen avatar Jingwei Xu avatar Hanlin avatar ChocolateDisco avatar murphy avatar Learning Chip avatar  avatar  avatar Fei Zhu avatar  avatar Hai Zhu avatar  avatar  avatar  avatar jiudianren avatar  avatar Yiwei Yang avatar Ruolin Ye avatar Garry Ling avatar  avatar Second Datke avatar Dirceu Jr. avatar  avatar Mingrui Zhang avatar Yuheng Zou avatar Yingwei Zheng avatar Mr Albedo avatar shinjin avatar Dunfan Lu avatar pengyu avatar Yi Xu avatar Ming Gao avatar  avatar Yingxiang He avatar Chang Yu avatar Madokakaroto avatar Zhiya Luo avatar yekuang avatar

Watchers

Chenfanfu Jiang avatar Minchen avatar  avatar  avatar  avatar  avatar Yadi Cao avatar Zhiya Luo avatar

zpc's Issues

Compile Error on Win11

cmake

cmake -B build -DZS_ENABLE_CUDA=ON -DZS_ENABLE_OPENVDB=ON -DZS_AUTO_DETECT_CUDA_ARCH=OFF -DCMAKE_CUDA_ARCHITECTURES=86

visual studio 2022 output

9>D:/10yac_workspace2/zpc/zpc/include\zensim/ZpcIterator.hpp(198): error : more than one operator "+" matches these operands:
9>            function template "zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl> zs::operator+(zs::sint_t, zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>)"
9>(391): here
9>            function template "zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl> zs::operator+(zs::detail::infer_difference_type_t<Self>, zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>)"
9>(303): here
9>            operand types are: zs::i64 + zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>
9>          detected during:
9>            instantiation of class "zs::is_ra_iter<Iter, zs::void_t<Iter &, zs::iterator_traits<Iter, void>::difference_type>> [with Iter=zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>]"
9>(204): here
9>            instantiation of "const __nv_bool zs::is_ra_iter_v [with Iter=zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>]"
9>(578): here
9>            instantiation of class "zs::zip_iterator<zs::tuple<Iters...>, zs::index_sequence<Is...>> [with Iters=<zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>, zs::LegacyIterator<zs::Vector<zs::i32, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>, zs::LegacyIterator<zs::Vector<zs::i32, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>, std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<zs::PropertyTag>>>>, Is=<0ULL, 1ULL, 2ULL, 3ULL>]"
9>(411): here
9>            instantiation of "auto zs::make_iterator<T,Args...>(Args &&...) [with T=zs::zip_iterator, Args=<zs::LegacyIterator<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>, zs::LegacyIterator<zs::Vector<zs::i32, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>, zs::LegacyIterator<zs::Vector<zs::i32, zs::ZSPmrAllocator<false, std::byte>>::iterator_impl>, std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<zs::PropertyTag>>>>]"
9>(690): here
9>            instantiation of "auto zs::zip(Args &&...) [with Args=<zs::Vector<zs::SmallString, zs::ZSPmrAllocator<false, std::byte>> &, zs::Vector<zs::i32, zs::ZSPmrAllocator<false, std::byte>> &, zs::Vector<zs::i32, zs::ZSPmrAllocator<false, std::byte>> &, const std::vector<zs::PropertyTag, std::allocator<zs::PropertyTag>> &>]"
9>D:/10yac_workspace2/zpc/zpc/include\zensim/container/TileVector.hpp(77): here
9>            instantiation of "zs::TileVector<T_, Length, AllocatorT>::TileVector(const zs::TileVector<T_, Length, AllocatorT>::allocator_type &, const std::vector<zs::PropertyTag, std::allocator<zs::PropertyTag>> &, zs::TileVector<T_, Length, AllocatorT>::size_type) [with T_=zs::i32, Length=8ULL, AllocatorT=zs::ZSPmrAllocator<false, std::byte>]"
9>D:/10yac_workspace2/zpc/zpc/include\zensim/container/TileVector.hpp(598): here
9>            instantiation of "void zs::TileVector<T_, Length, AllocatorT>::append_channels(Policy &&, const std::vector<zs::PropertyTag, std::allocator<zs::PropertyTag>> &) [with T_=zs::i32, Length=8ULL, AllocatorT=zs::ZSPmrAllocator<false, std::byte>, Policy=zs::CudaExecutionPolicy &]"
9>D:\10yac_workspace2\zpc\zpc\include\zensim\py_interop\cuda\TileVectorUtility.cpp(19): here

Compile error on windows 11

I got error on windows 11 while compiling zpc “ ptxas fatal : SM version specified by .target is higher than default SM version assumed”,compile process would be ok with parameter ZS_ENABLE_CUDA=OFF.

the error message when building zpc is such:
$ cmake --build . --parallel 8 --config Release
MSBuild version 17.6.3+07e294721 for .NET Framework

zpccore.vcxproj -> D:\github\zpc\build\include\zensim\Release\zpccore.lib
zpcomp.vcxproj -> D:\github\zpc\build\include\zensim\Release\zpcomp.lib
zpccuda.vcxproj -> D:\github\zpc\build\include\zensim\Release\zpccuda.lib
zpc.vcxproj -> D:\github\zpc\build\include\zensim\Release\zpc.lib

D:\github\zpc\build\include\zensim>"D:\software\NVDIA GPU Computing Toolkit\CUDA\v12.1\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"D:\software\NVDIA GPU Computing Toolkit\CUDA\v12.1\bin/crt" -L"D:\software\NVDIA GPU Computing Toolkit\CUDA\v12.1\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 zs_cu_wrangler.dir\Release\VolumeWrangler.ptx zs_cu_wrangler.dir\Release\ParticleWrangler.ptx
ptxas fatal : SM version specified by .target is higher than default SM version assumed
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
VolumeWrangler.ptx
D:\software\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.1.targets(908,9): error MSB3721: 命令“"D:\software\NVDIA GPU Computing Toolkit\CUDA\v12.1\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"D:\software\NVDIA GPU Computing Toolkit\CUDA\v12.1\bin/crt" -L"D:\software\NVDIA GPU Computing Toolkit\CUDA\v12.1\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 zs_cu_wrangler.dir\Release\VolumeWrangler.ptx zs_cu_wrangler.dir\Release\ParticleWrangler.ptx”已退出,返回代码为 255。 [D:\github\zpc\build\include\zensim\zs_cu_wrangler.vcxproj]

pastebin

=== ZFX
define f3 @pos
define f3 @vel
define f1 arg0
parname arg0.0
@vel += arg0 * vec3(0,-9.8,0)
@pos += @vel * arg0

=== Parser
(+= vel (* arg0 (vec3 0 (- 9.8) 0)))
(+= pos (* vel arg0))
=== Transcriptor

  • #9.8 $_Tm0
    vec3 #0 $_Tm0 #0 $_Tm1
  • $arg0 $_Tm1 $_Tm2
  • $_Tm3 @pos @pos
    === InitialPass
    sub $_Tm0 #9.8
    vec3 $_Tm1 #0 $_Tm0 #0
    mul $_Tm2 $arg0 $_Tm1
    add @vel $_Tm2 @vel
    mul $_Tm3 @vel $arg0
    add @pos $_Tm3 @pos
    === UnfuncPass
    define f1 $_Tm0
    define f1 $_Tm1
    define f1 $_Tm2
    define f3 $_Tm3
    define f3 $_Tp0
    define f1 $arg0
    define f3 @pos
    define f3 @vel
    sub $_Tm0 #9.8
    mov $_Tp0.0 #0
    mov $_Tp0.1 $_Tm0
    mov $_Tp0.2 #0
    mov $_Tm1 $_Tp0
    mul $_Tm2 $arg0 $_Tm1
    add @vel $_Tm2 @vel
    mul $_Tm3 @vel $arg0
    add @pos $_Tm3 @pos
    === UnwrapPass
    define f1 $_Tm0
    define f3 $_Tm1
    define f3 $_Tm2
    define f3 $_Tm3
    define f3 $_Tp0
    define f1 $_Tp0.0
    define f1 $_Tp0.1
    define f1 $_Tp0.2
    define f1 $arg0
    define f3 @pos
    define f3 @vel
    sub $_Tm0.0 #9.8
    mov $_Tp0.0 #0
    mov $_Tp0.0 #0
    mov $_Tp0.0 #0
    mov $_Tp0.1 $_Tm0.0
    mov $_Tp0.1 $_Tm0.0
    mov $_Tp0.1 $_Tm0.0
    mov $_Tp0.2 #0
    mov $_Tp0.2 #0
    mov $_Tp0.2 #0
    mov $_Tm1.0 $_Tp0.0
    mov $_Tm1.1 $_Tp0.1
    mov $_Tm1.2 $_Tp0.2
    mul $_Tm2.0 $arg0.0 $_Tm1.0
    mul $_Tm2.1 $arg0.0 $_Tm1.1
    mul $_Tm2.2 $arg0.0 $_Tm1.2
    add @vel.0 $_Tm2.0 @vel.0
    add @vel.1 $_Tm2.1 @vel.1
    add @vel.2 $_Tm2.2 @vel.2
    mul $_Tm3.0 @vel.0 $arg0.0
    mul $_Tm3.1 @vel.1 $arg0.0
    mul $_Tm3.2 @vel.2 $arg0.0
    add @pos.0 $_Tm3.0 @pos.0
    add @pos.1 $_Tm3.1 @pos.1
    add @pos.2 $_Tm3.2 @pos.2
    === ReassignPass
    bind 3 pos.0
    bind 4 pos.1
    bind 5 pos.2
    bind 0 vel.0
    bind 1 vel.1
    bind 2 vel.2
    parm 0 arg0.0
    sub $1 #9.8
    mov $2 #0
    mov $2 #0
    mov $2 #0
    mov $3 $1
    mov $3 $1
    mov $3 $1
    mov $4 #0
    mov $4 #0
    mov $4 #0
    mov $5 $2
    mov $6 $3
    mov $7 $4
    mul $8 $0 $5
    mul $9 $0 $6
    mul $10 $0 $7
    add @0 $8 @0
    add @1 $9 @1
    add @2 $10 @2
    mul $11 @0 $0
    mul $12 @1 $0
    mul $13 @2 $0
    add @3 $11 @3
    add @4 $12 @4
    add @5 $13 @5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.