projectchrono / chrono

High-performance C++ library for multiphysics and multibody dynamics simulations
http://projectchrono.org
BSD 3-Clause "New" or "Revised" License
2.18k stars 456 forks source link

unable to use gpu #474

Open cslxiao opened 9 months ago

cslxiao commented 9 months ago

I ran the demo demo_VEH_HMMWV, but it didn't use the NVIDIA GPU. So it is really slow. How to solve it? Btw, my nvidia driver and cuda is OK and I can run deep learning programs.

❯ ./demo_VEH_HMMWV
Copyright (c) 2017 projectchrono.org
Chrono version: 8.0.0

Combined Force calculation!
Desired section [DEFLECTION_LOAD_CURVE] not found, using linear vertical stiffness.
Desired section [BOTTOMING_CURVE] not found, no bottoming stiffness set.
Combined Force calculation!
Desired section [DEFLECTION_LOAD_CURVE] not found, using linear vertical stiffness.
Desired section [BOTTOMING_CURVE] not found, no bottoming stiffness set.
Combined Force calculation!
Desired section [DEFLECTION_LOAD_CURVE] not found, using linear vertical stiffness.
Desired section [BOTTOMING_CURVE] not found, no bottoming stiffness set.
Combined Force calculation!
Desired section [DEFLECTION_LOAD_CURVE] not found, using linear vertical stiffness.
Desired section [BOTTOMING_CURVE] not found, no bottoming stiffness set.
Irrlicht Engine version 1.8.4
Linux 5.15.0-89-generic #99~20.04.1-Ubuntu SMP Thu Nov 2 15:16:47 UTC 2023 x86_64
Using plain X visual
This driver is not available in Linux. Try OpenGL or Software renderer.
Cannot use default video driver - fall back to OpenGL
Irrlicht Engine version 1.8.4
Linux 5.15.0-89-generic #99~20.04.1-Ubuntu SMP Thu Nov 2 15:16:47 UTC 2023 x86_64
Using renderer: OpenGL 4.6
Mesa Intel(R) UHD Graphics (CML GT2): Intel
OpenGL driver version is 1.2 or better.
GLSL version: 4.6
dariomangoni commented 9 months ago

Hi Liang, for this usage suggestions we usually recommend to use our Google Group, so to restrict Github Issues only to proper code issues.

About your request: please consider that Chrono core module and vehicle (at least for what concerns that demo) do not run their computations on GPU. Only specific modules do that.

On the contrary, if you are just talking about the rendering, you need to tell through the Nvidia Control Panel that you want your specific application (in this case I recommend Visual Studio if you are launching the demo from it) to use Nvidia graphic card and not the integrated one.

However, please mind that the time spent in the rendering is usually only just a small amount of the whole computational cost, so I wouldn't expect huge improvements.

BTW, did you make sure you compiled in Release and not Debug mode? Dario