PRBonn / PIN_SLAM

📍PIN-SLAM: LiDAR SLAM Using a Point-Based Implicit Neural Representation for Achieving Global Map Consistency [TRO' 24]
MIT License
321 stars 30 forks source link

CUDA error even when using cpu yaml #10

Closed Omar-Nour closed 5 months ago

Omar-Nour commented 5 months ago

Hello and thank you for your great work.

I was trying to use this command python pin_slam.py ./config/lidar_slam/run_demo_cpu.yaml to run the initial test but i get this error:

  File "pin_slam.py", line 380, in <module>
    run_pin_slam()
  File "pin_slam.py", line 103, in run_pin_slam
    T0 = get_time()
  File "/home/omar-nour/catkin_ws/src/PIN_SLAM/utils/tools.py", line 273, in get_time
    torch.cuda.synchronize()
  File "/home/omar-nour/miniconda3/envs/pin/lib/python3.8/site-packages/torch/cuda/__init__.py", line 799, in synchronize
    _lazy_init()
  File "/home/omar-nour/miniconda3/envs/pin/lib/python3.8/site-packages/torch/cuda/__init__.py", line 302, in _lazy_init
    torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available

I am trying to run PIN-SLAM on Ubuntu 20.04 Virtual Machine (Virtual Box) with ROS Noetic

YuePanEdward commented 5 months ago

Thanks for your interest in our work and the report of this bug. This is due to the blind torch.cuda.synchronize() call in get_time() when there's no cuda devices (CPU only). Now you can pull the latest version and try it again.