MisEty / RTG-SLAM

RTG-SLAM: Real-time 3D Reconstruction at Scale Using Gaussian Splatting (ACM SIGGRAPH 2024)
https://gapszju.github.io/RTG-SLAM/
GNU General Public License v3.0
174 stars 12 forks source link

No CUDA GPUs is available #9

Closed Masrur02 closed 1 week ago

Masrur02 commented 1 week ago

I got the following error. How to solve? TIA


/home/khan/Downloads/Research_USA/RTG-SLAM/utils/general_utils.py:22: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /opt/conda/conda-bld/pytorch_1670525539683/work/torch/csrc/utils/tensor_numpy.cpp:77.)
  float_dev = torch.tensor([0], device="cuda", dtype=torch.float32)
Traceback (most recent call last):
  File "/home/khan/Downloads/Research_USA/RTG-SLAM/slam.py", line 13, in <module>
    from utils.camera_utils import loadCam
  File "/home/khan/Downloads/Research_USA/RTG-SLAM/utils/camera_utils.py", line 15, in <module>
    from scene.cameras import Camera
  File "/home/khan/Downloads/Research_USA/RTG-SLAM/scene/__init__.py", line 13, in <module>
    from scene.dataset_readers import sceneLoadTypeCallbacks
  File "/home/khan/Downloads/Research_USA/RTG-SLAM/scene/dataset_readers.py", line 34, in <module>
    from scene.gaussian_model import BasicPointCloud
  File "/home/khan/Downloads/Research_USA/RTG-SLAM/scene/gaussian_model.py", line 20, in <module>
    from utils.general_utils import (
  File "/home/khan/Downloads/Research_USA/RTG-SLAM/utils/general_utils.py", line 22, in <module>
    float_dev = torch.tensor([0], device="cuda", dtype=torch.float32)
  File "/home/khan/anaconda3/envs/slam/lib/python3.9/site-packages/torch/cuda/__init__.py", line 229, in _lazy_init
    torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
Masrur02 commented 1 week ago

The issue is due to this line os.environ["CUDA_VISIBLE_DEVICES"] = ",".join(str(device) for device in args.device_list)

for single GPU system the code should be only

os.environ["CUDA_VISIBLE_DEVICES"] = 0

And the issue is solved