ACDSLab / MPPI-Generic

Templated C++/CUDA implementation of Model Predictive Path Integral Control (MPPI)
https://acdslab.github.io/mppi-generic-website/
BSD 2-Clause "Simplified" License
52 stars 4 forks source link

cartpole_example Segmentation fault #4

Closed EPVelasco closed 1 day ago

EPVelasco commented 2 days ago

Hi, I have compiled everything but I can't run the example ./cartpole_example. I have this error: Segmentation fault (core dumped)

However, the double_integrator_example and double_integrator_CORL2020 examples run.

image

My CUDA version is: image

bogidude commented 2 days ago

This might be related to #2. We are looking into it

bosky2001 commented 1 day ago

@EPVelasco I compiled it as a .cu file instead .cpp and that fixed it for me! I don't really know why or how that worked , but I don't get the seg fault error anymore.

bogidude commented 1 day ago

Changing it to a .cu file worked because then all the header files for dynamics, cost functions, etc. will include their CUDA method definitions into the compilation of the executable. However, we would like to support the capability for someone to choose to compile all of the CUDA-specific code they need (an MPPI controller for cartpole for example) into a shared library and then link to it from a cpp-based executable. This seems to be currently broken so I shall set it to be a .cu file for now while we investigate this further.

bogidude commented 1 day ago

Fixed in #3 and has been merged into main with .cu workaround for now.