Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtorch crashing core dump #76229

Closed
natxopedreira opened this issue Apr 22, 2022 · 2 comments
Closed

libtorch crashing core dump #76229

natxopedreira opened this issue Apr 22, 2022 · 2 comments
Labels
module: cpp Related to C++ API module: crash Problem manifests as a hard crash, as opposed to a RuntimeError triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@natxopedreira
Copy link

natxopedreira commented Apr 22, 2022

馃悰 Describe the bug

Just trying to integrate libtorch in another c++ platform, is building but crashing on launch

Im compiling with gcc -L./libtorch/lib/ -ltorch_cpu -lc10

terminate called after throwing an instance of 'c10::Error'
  what():  _ivalue_INTERNAL ASSERT FAILED at "../torch/csrc/jit/api/object.h":35, please report a bug to PyTorch. 
Exception raised from _ivalue at ../torch/csrc/jit/api/object.h:35 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6b (0x7ffa965bb0eb in /home/natxo/of_v0.11.2_linux64gcc6_release/apps/myApps/pytorch_example/libtorch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*) + 0xd1 (0x7ffa965b6c41 in /home/natxo/of_v0.11.2_linux64gcc6_release/apps/myApps/pytorch_example/libtorch/lib/libc10.so)
frame #2: torch::jit::Object::find_method(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const + 0x33f (0x7ffa999aeb5f in /home/natxo/of_v0.11.2_linux64gcc6_release/apps/myApps/pytorch_example/libtorch/lib/libtorch_cpu.so)
frame #3: <unknown function> + 0x93753 (0x55775d422753 in ./pytorch_example)
frame #4: <unknown function> + 0xad337 (0x55775d43c337 in ./pytorch_example)
frame #5: <unknown function> + 0x1d5c14 (0x55775d564c14 in ./pytorch_example)
frame #6: <unknown function> + 0xa1c74 (0x55775d430c74 in ./pytorch_example)
frame #7: <unknown function> + 0xa945c (0x55775d43845c in ./pytorch_example)
frame #8: <unknown function> + 0xa965c (0x55775d43865c in ./pytorch_example)
frame #9: <unknown function> + 0x9e76d (0x55775d42d76d in ./pytorch_example)
frame #10: main + 0xd5 (0x55775d4039b5 in ./pytorch_example)
frame #11: __libc_start_main + 0xf3 (0x7ffa947670b3 in /lib/x86_64-linux-gnu/libc.so.6)
frame #12: <unknown function> + 0x9039e (0x55775d41f39e in ./pytorch_example)

Aborted (core dumped)

Versions

PyTorch version: 1.9.0+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.21.4
Libc version: glibc-2.31

Python version: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.13.0-40-generic-x86_64-with-glibc2.29
Is CUDA available: True
CUDA runtime version: 11.2.67
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1070
Nvidia driver version: 470.103.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.1.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.22.3
[pip3] numpydoc==0.7.0
[pip3] torch==1.9.0
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.10.0
[conda] blas 1.0 mkl
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py38h7f8727e_0
[conda] mkl_fft 1.3.1 py38hd3c417c_0
[conda] mkl_random 1.2.2 py38h51133e4_0
[conda] mypy_extensions 0.4.3 py38h06a4308_1
[conda] numpy 1.19.5 pypi_0 pypi
[conda] numpydoc 1.2 pyhd3eb1b0_0

cc @jbschlosser

@mrshenli mrshenli added module: crash Problem manifests as a hard crash, as opposed to a RuntimeError module: cpp Related to C++ API triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Apr 24, 2022
@natxopedreira
Copy link
Author

I compiled from source, installed and works now.

@D-jojo
Copy link

D-jojo commented Jan 5, 2024

@natxopedreira Hi,
May I ask how you solved this problem? I have recently encountered a similar problem.
terminate called after throwing an instance of 'c10::Error'
what(): _ivalue_INTERNAL ASSERT FAILED at "../torch/csrc/jit/api/object.h":35, please report a bug to PyTorch.
Exception raised from ivalue at ../torch/csrc/jit/api/object.h:35 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::cxx11::basic_string<char, std::char_traits, std::allocator >) + 0xa0 (0xffff9ea71e30 in /home/xyb/sd/djj/env_djj/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*) + 0xe8 (0xffff9ea53ad4 in /home/xyb/sd/djj/env_djj/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #2: torch::jit::Object::find_method(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) const + 0x554 (0xffffb080e6c4 in /home/xyb/sd/djj/env_djj/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #3: Model::evaluate(std::vector<double, std::allocator > const&, bool) + 0x278 (0xffffb262d9a8 in /home/xyb/sd/djj/cms_ws/catkin_cms/devel/lib/libcpp_policy.so)
frame #4: agile_locomotion::AgileLocomotion::startWalking() + 0xb50 (0xaaaacbd32190 in /home/xyb/sd/djj/cms_ws/catkin_cms/devel/lib/agile_locomotion/agile_locomotion)
frame #5: agile_locomotion::AgileLocomotion::startExecutionCallback(boost::shared_ptr<std_msgs::Empty
<std::allocator > const> const&) + 0x130 (0xaaaacbd33318 in /home/xyb/sd/djj/cms_ws/catkin_cms/devel/lib/agile_locomotion/agile_locomotion)
frame #6: boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<std_msgs::Empty
<std::allocator > const> const&)>, void, boost::shared_ptr<std_msgs::Empty
<std::allocator > const> >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<std_msgs::Empty<std::allocator > const>) + 0x3c (0xaaaacbd4347c in /home/xyb/sd/djj/cms_ws/catkin_cms/devel/lib/agile_locomotion/agile_locomotion)
frame #7: ros::SubscriptionCallbackHelperT<boost::shared_ptr<std_msgs::Empty<std::allocator > const> const&, void>::call(ros::SubscriptionCallbackHelperCallParams&) + 0x1e8 (0xaaaacbd43f48 in /home/xyb/sd/djj/cms_ws/catkin_cms/devel/lib/agile_locomotion/agile_locomotion)
frame #8: ros::SubscriptionQueue::call() + 0x9a4 (0xffffb28c8e6c in /opt/ros/noetic/lib/libroscpp.so)
frame #9: ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) + 0x274 (0xffffb2874a6c in /opt/ros/noetic/lib/libroscpp.so)
frame #10: ros::CallbackQueue::callOne(ros::WallDuration) + 0x1d8 (0xffffb2875780 in /opt/ros/noetic/lib/libroscpp.so)
frame #11: ros::AsyncSpinnerImpl::threadFunc() + 0x64 (0xffffb28cb8bc in /opt/ros/noetic/lib/libroscpp.so)
frame #12: + 0x10624 (0xffff9e3c2624 in /lib/aarch64-linux-gnu/libboost_thread.so.1.71.0)
frame #13: + 0x7624 (0xffffb2714624 in /lib/aarch64-linux-gnu/libpthread.so.0)
frame #14: + 0xd149c (0xffff9e78249c in /lib/aarch64-linux-gnu/libc.so.6)

I am looking forward to your reply very much, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cpp Related to C++ API module: crash Problem manifests as a hard crash, as opposed to a RuntimeError triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants