sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
906 stars 309 forks source link

SofaCUDA can't call nvidia rtx 4060! #4423

Open q1221sr opened 8 months ago

q1221sr commented 8 months ago

i use sofa 22.12 by vs2022 cmake 3.27.2 Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045. just use option SOFACUDA_THRUST in plugin_sofacuda and i use rtx 4060, nvidia driver 546.12, cuda 11.8, cudnn 8.9.6

I successfully compiled plugin_sofacuda, ran liver-CUDA.scn using runsofa, and I noticed that only the GPU0(Intel(R) UHD Graphics) were used in the performance probe instead of the GPU1(GeForce RTX 4060 Laptop GPU) (just 0%!)

how to use 4060 to Accelerating my sofa simulation?

alxbilger commented 8 months ago

Hi, I just discovered that you can select the device using the CUDA_DEVICE environment variable. I've never tried it though.

Normally, you should have a console print looking like CUDA: Using device DEVICE_ID : DEVICE_NAME at the initialization of the CUDA module.

alxbilger commented 8 months ago

Thinking about it again, Intel(R) UHD Graphics is not a cuda capable device, so it will not be used for computation (rendering maybe?).

What's the content of DEVICE_ID and DEVICE_NAME in the log message CUDA: Using device DEVICE_ID : DEVICE_NAME? What do you use to measure the performances?