Error on Google Colab saying Requires CUDA, which is not available on your system

huangapple go评论94阅读模式
英文:

Error on Google Colab saying Requires CUDA, which is not available on your system

问题

我正在尝试在Google Colab上运行来自此库的以下代码:https://github.com/colmap/pycolmap
我使用Google Colab是因为它提供了预安装的CUDA。

output_path: pathlib.Path
image_dir: pathlib.Path

output_path.mkdir()
mvs_path = output_path / "mvs"
database_path = output_path / "database.db"

pycolmap.extract_features(database_path, image_dir)
pycolmap.match_exhaustive(database_path)
maps = pycolmap.incremental_mapping(database_path, image_dir, output_path)
maps[0].write(output_path)
# dense reconstruction
pycolmap.undistort_images(mvs_path, output_path, image_dir)
pycolmap.patch_match_stereo(mvs_path)  # 需要CUDA编译
pycolmap.stereo_fusion(mvs_path / "dense.ply", mvs_path)

但是,我收到以下错误:
密集立体重建需要CUDA,但您的系统不支持。

----> 2 pycolmap.patch_match_stereo(mvs_path)  # 需要CUDA编译
      3 pycolmap.stereo_fusion(mvs_path / "dense.ply", mvs_path)

RuntimeError: [mvs.cc:38] ERROR: 密集立体重建需要CUDA,但您的系统不支持。

有人可以解释为什么吗?谢谢。

当我检查CUDA时,它显示为可用:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

我还选择了GPU,使用以下方法:
转到菜单 > Runtime > 更改运行时。

英文:

I am trying to run the following code on Google colab from this library:
https://github.com/colmap/pycolmap
I use Google Colab because it offers preinstalled CUDA

output_path: pathlib.Path
image_dir: pathlib.Path

output_path.mkdir()
mvs_path = output_path / "mvs"
database_path = output_path / "database.db"

pycolmap.extract_features(database_path, image_dir)
pycolmap.match_exhaustive(database_path)
maps = pycolmap.incremental_mapping(database_path, image_dir, output_path)
maps[0].write(output_path)
# dense reconstruction
pycolmap.undistort_images(mvs_path, output_path, image_dir)
pycolmap.patch_match_stereo(mvs_path)  # requires compilation with CUDA
pycolmap.stereo_fusion(mvs_path / "dense.ply", mvs_path)


However, I am getting error saying :
Dense stereo reconstruction requires CUDA, which is not available on your system.

  ----> 2 pycolmap.patch_match_stereo(mvs_path)  # requires compilation with CUDA
          3 pycolmap.stereo_fusion(mvs_path / "dense.ply", mvs_path)
    
    RuntimeError: [mvs.cc:38] ERROR: Dense stereo reconstruction requires CUDA, which is not available on your system.

Can someone explain why? Thank you.

When I check for CUDA, it says available

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

I have also selected GPU using the following
Go to Menu > Runtime > Change runtime.

答案1

得分: 0

根据文档

> 请注意,Linux/Unix/BSD默认存储库中的COLMAP包不支持CUDA,需要手动编译,但在这些平台上相对容易。

以下是启用CUDA的源代码安装步骤。

!git克隆https://github.com/colmap/colmap.git
!cd colmap
!git切换到dev分支
!创建build文件夹
!cd build
!cmake ..
英文:

According to the documentation:

> Note that the COLMAP packages in the default repositories for Linux/Unix/BSD do not come with CUDA support, which requires manual compilation but is relatively easy on these platforms.

There's the steps to install it from source with CUDA enabled.

!git clone https://github.com/colmap/colmap.git
!cd colmap
!git checkout dev
!mkdir build
!cd build
!cmake ..

huangapple
  • 本文由 发表于 2023年7月3日 12:58:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76601933.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定