Thrust library and PARALLEL module install faild

342 views
Skip to first unread message

Page

unread,
Oct 10, 2023, 10:37:53 PM10/10/23
to ProjectChrono

Hello All,

I'm beginner to chrono, and I'm particularly interested in small particle fluid simulation, so I downloaded the source code for demo_MBS_sph, but it's very slow and I want to learn how to use a GPU for acceleration. So I downloaded the demo_GPU_ballCosim source code to study, but couldn't figure out why it didn't have a visual rendering window. I wanted to use the PARALLEL module, but I had a problem installing it.

1. After the Thrust library was downloaded, it took 6 hours to build and 4 errors occurred. error MSB3721: The command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin\nvcc.exe" -- use-local-env-ccbin "E:\VS2022\IDE\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64" -x cu-IE :\Chrono\Thrust\thrust\testing -IE:\Chrono\Thrust\thrust\thrust\cmake\.. \.. -IE:\Chrono\Thrust\thrust\dependencies\libcudacxx\include -IE:\Chrono\Thrust\thrust\dependencies\cub\cub\cmake\.. \.. -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\include" --keep-dir x64\ Debug-maxrregcount =0 --machine 64 --compile -cudart static -gencode arch=compute_90,code=compute_90 -gencode arch=compute_50,code=sm_50  -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode  arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode  arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode  arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -std=c++14 -Xcudafe=--display_error_number  -Wno-deprecated-gpu-targets -Xcudafe=--promote_warnings -Xcompiler="/EHsc -Zi -Ob0 /wd4324 /wd4505 /wd4706 /wd4244  /wd4146 /wd4494 /bigobj /wd4127" -g  -D_WINDOWS -DTHRUST_TEST_DEVICE_SIDE -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP  -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DNOMINMAX -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS  -D"CMAKE_INTDIR=\"Debug\"" -Xcompiler "/EHsc /W4 /nologo /Od /Fdthrust.test.copy.dir\Debug\vc143.pdb /FS /Zi /RTC1 /MDd  /GR" -o thrust.test.copy.dir\Debug\copy.obj "E:\Chrono\Thrust\thrust\testing\copy.cu" has exited, returning code 1. 81> The thrust.test.copy.vcxproj project has been generated. - Failed.

2.I will ignore these mistakes for the time being.look at the tutorial :

https://api.projectchrono.org/module_parallel_installation.html

to continue to do, I want to start the PARALLEL cmake configuration module, but there was no E I cmake NABLE_MODULE_PARALLEL This option.

3. I want to ask, want to see the small particle simulation project, but also want to make the project run faster, what should I do? Thank you very much.

Radu Serban

unread,
Oct 11, 2023, 1:45:21 AM10/11/23
to ProjectChrono

The “parallel” module was renamed (a long time ago) to the “multicore” module. This is why you cannot find it or enable it during CMake configuration. (As a side note, I have no idea where/how you got the link you posted below!)

 

Having said that, this multicore module offers parallelization through OpenMP. For better performance, you should look at the Chrono::GPU module which also offers DEM capabilities (albeit only the so-called “penalty formulation”) or better yet to the newer DEME package.  The latter two are GPU codes (based on CUDA, hence requiring an Nvidia GPU).

 

Note that the Thrust library comes with any recent CUDA distribution, so there’s nothing you need to do about Thrust if you install CUDA (which you will need anyway if you want to use any of the GPU codes).  The Chrono::Multicore module also requires Thrust (but uses its OpenMP backend).  If you do not have an Nvidia GPU and only want to use the Chrono::Multicore module, you can indeed get Thrust stand-alone. But even then, Thrust is a headers-only library, so there’s no need to build anything to be able to use it.

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/3728dd7f-a81b-4188-95a6-656528e2034cn%40googlegroups.com.

Message has been deleted

Page

unread,
Oct 12, 2023, 9:51:51 PM10/12/23
to ProjectChrono

Hi,Radu

Thanks for your reply, I found the multicore module. The Demo ran successfully, but I still have to install the OpengGL module for visualization, as per this page https://api.projectchrono.org/module_opengl_installation.html to install opengl,after clicking builtsl.bat, in my C:\Packages\gl directory only the include file is generated, and there is no lib folder as described in the documentation

CMake Error at D:/CMake/cmake-3.27.6-windows-x86_64/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find GLEW (missing: GLEW_INCLUDE_DIRS GLEW_LIBRARIES)
Call Stack (most recent call first):
D:/CMake/cmake-3.27.6-windows-x86_64/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
D:/CMake/cmake-3.27.6-windows-x86_64/share/cmake-3.27/Modules/FindGLEW.cmake:238 (find_package_handle_standard_args)
src/chrono_opengl/CMakeLists.txt:42 (find_package)

I need your help

Radu Serban

unread,
Oct 13, 2023, 2:07:27 AM10/13/23
to ProjectChrono

Page,

 

I just rechecked that the buildGL.bat script provided with the Chrono distribution, and everything works as expected.

 

  1. Make sure you have the latest Chrono code.
  2. As indicated in the installation instruction on the Chrono webpage, you should maybe copy the script in a temporary directory and edit it to change settings as needed on your machine (e.g., change where the GL dependencies will be installed).
  3. Run the script from a terminal (not by double clicking on it!). This script will download, uncompress, configure, build, and install the GL dependency libraries.
  4. When running, the script will create additional subdirectories.  Check that the ‘download_gl/’ directory contains the expected downloaded packages. Check that the ‘build_glew/’ and ‘build_glfw/’ directories were created.
  5. Check the output of running the buildGL.bat script to figure out what goes wrong in your case.
  6. Finally, check that the installation directory (the location you selected when editing your local copy of the script in step 2 above) contains 3 subdirectories, named ‘bin/’, ‘include/’, and ‘lib/’.

 

Once you successfully get the GL dependencies built and installed, when configuring Chrono with CMake, you will need to set the GLEW_DIR and GLM_INCLUDE_DIR variables appropriately to point to the corresponding directories in the GL install directory.

Page

unread,
Oct 18, 2023, 4:36:47 AM10/18/23
to ProjectChrono

Hi,Radu

Thank you very much for your answer, I found the question :(Run the script from a terminal (not by double clicking on it!) I have successfully run the multicore module demo, but I still have the following questions:

1. I saw in the multicore module demo that both CPU and GPU worked, but when I increased the number of particles, the picture was very slow, and I didn't understand, Why is the GPU in the calculation, the simulation picture is still very slow?

2.So I tried to use GPU module, when running GPU module, there was no rendering window, is it because I did not install VSG module? so I tried to install VSG module, there was a problem when installing VSG module, I ran the buildVSG.bat script in the terminal,Each time I run it I get same errors, such as Failed to clone 'src/implot'. and Failed to clone 'src/imgui'.

CMake Warning at CMakeLists.txt:25 (find_package):

By not providing "Findvsg.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "vsg", but CMake did not find one.

 

Could not find a package configuration file provided by "vsg" (requested version 1.0.5) with any of the following names:

vsgConfig.cmake

vsg-config.cmake

Add the installation prefix of "vsg" to CMAKE_PREFIX_PATH or set "vsg_DIR" to a directory containing one of the above files.  If "vsg" provides a separate development package or SDK, be sure it has been installed.

 

in C:\Packages\vsg\lib\cmake only generated 3 files :assimp-5.2,vsg,vsgXchange, no vsgImGui, what did I do wrong?

Thank you very much for developing such a powerful engine

Radu Serban

unread,
Oct 21, 2023, 3:03:27 AM10/21/23
to ProjectChrono
  1. In Chrono::Multicore, the GPU is used for other types of simulation (an MPM code which is currently not actively maintained).  The GPU in that model is not used to accelerate granular dynamics. 
  2. Currently, the Chrono::GPU module only supports run-time visualization through Chrono::OpenGL (no VSG support at this time).  To get that going, you will need to set ENABLE_MODULE_OPENGL to “on” during CMake configuration and have various GL dependency libraries available. See the corresponding installation page for that module.
  3. Beware of using runtime visualization with any of the GPU-0based codes. That slows down the overall simulation by quite a bit (since data needs to be transferred back and forth between the GPU and the CPU). This should only be used as a way to verify your model and simulation, and then disabled for performance runs.

 

Regarding the errors you get while installing the VSG dependencies:

  1. It seems that you are using an older version of the Chrono code. Please pull the latest code from the ‘main’ git branch. The ‘buidVSG.bat’ script in this latest code should attempt to build vsg v 1.0.7 (and not 1.0.5 as your message indicates)
  2. If you want us to be able to help, please provide more complete information. In this case, please run the buildVSG.bat script from a terminal, redirect output to a file, and share that output with us.  Make sure you follow the instructions in the comments at the top of buildVSG.bat and, as indicated there, edit the script as appropriate.

Page

unread,
Oct 22, 2023, 10:43:17 AM10/22/23
to ProjectChrono

Hi,Radu

Thanks for your answer, I'm really excited to explore Chrono every day. I have successfully installed the VSG module, but when running the error: FATAL: VulkanSceneGraph not compiled with GLSLang, unable to compile shaders, I do not know how to solve.

After that, I installed DEME, I used cmake-gui to configure, I had selected TargetCXXStandard to STD_CXX17, but there were still a lot of syntax errors after build.

I saw this video (https://www.youtube.com/watch?v=ev_WcruedXo) is really cool.Is this running visualization? What module? Or offline rendering?where can I download this source?

Ruochun Zhang

unread,
Oct 22, 2023, 11:35:49 AM10/22/23
to ProjectChrono
Hi Page,

Note that right now, DEME works on Linux only and there is no integrated run-time visualization. But if you built it on Linux and still got syntax errors, you could post them here if you need help.

Thank you,
Ruochun

Page

unread,
Oct 23, 2023, 5:09:13 AM10/23/23
to ProjectChrono

Hi,Ruochun

I am sad because DEM does not support the window system. How can I achieve such real-time rendering effects in the window system?

(https://www.youtube.com/watch?v=ev_WcruedXo)

Ruochun Zhang

unread,
Oct 23, 2023, 5:19:51 AM10/23/23
to ProjectChrono
Hi Page,

That movie is about an SPH simulation. I am not familiar with either the underlying simulation or the rendering technique used. Sorry.

Ruochun

Page

unread,
Oct 23, 2023, 5:59:55 AM10/23/23
to ProjectChrono

Hi Ruochun,

Thank you ,It's okay, I'll explore SPH simulation myself later.I encountered this error after installing the VSG module :

FATAL: VulkanSceneGraph not compiled with GLSLang, unacompile ble to shaders.

I don't know how to solve it

Page

Radu Serban

unread,
Oct 23, 2023, 7:55:18 AM10/23/23
to ProjectChrono

Page,

 

A few clarifications:

 

  • The simulation of a vehicle fording a river is *not* SPH, but rather a simulation using the so-called “constrained fluid” approach for CFD. That is available in Chrono::Multicore. While that particular simulation is not provided as a demo in Chrono, you can look at demo_MCORE_fluidNSC which uses that method for a simpler scenario.
  • None of these more complex simulations (DEM, SPH, constrained fluid) will run in real time! Quite far from it.
  • As I mentioned to you before, we provide run-time visualization for such simulations mostly as a visual debugging tool.  If anything, run-time visualization adds to the computational cost.
  • Rendering of results from such simulations is done as a post-processing step, using various tools and techniques. That particular fording simulation was most likely done with Mitsuba. One other option is to use Blender (look at the relatively new Blender plugin for Chrono).
  • Regarding your difficulties in getting VSG to work, that appears to be an issue with you getting all necessary dependencies properly installed. We cannot provide help and support for all of these third-party libraries and tools. You will need to read more about those yourself, or else take it up with the developers of those particular packages.  In this case, you are having trouble getting VSG built and install properly, so that’s where you would start.  Having said that, I suspect that the problem is that you have not properly set up the necessary environment variables for VSG to find your installation of the Vulkan SDK (namely, you must set VULKAN_SDK)

Page

unread,
Oct 31, 2023, 3:02:53 AM10/31/23
to ProjectChrono
Hi,Radu

Thanks for your answer.

I am going to do visualization in UE, I created ChBodyEasyBox object, but I can't find its mesh data. where is the vertex data or  face data?

Radu Serban

unread,
Oct 31, 2023, 7:04:53 AM10/31/23
to ProjectChrono

Page, there is no mesh data you can access for any of the primitive shapes. That is left to the individual visualization systems. You can see how that’s done for Chrono::Irrlicht, or Chrono::VSG, or Chrono::OpenGL.  In your case, you need to deal with this yourself on the UE side.

Reply all
Reply to author
Forward
0 new messages