OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.92k stars 1.11k forks source link

【bug】 `openmvs.py` gpu_config set --cuda-device -1 or --cuda-device -2, cant use GPU #1733

Closed xueshuai0922 closed 11 months ago

xueshuai0922 commented 11 months ago

How did you install ODM? (Docker, installer, natively, ...)?

docker nodeOdm

What is the problem?

【bug】 openmvs.py gpu_config set --cuda-device -1 or --cuda-device -2, cant use GPU

config = [
                "--resolution-level %s" % int(resolution_level),
                '--dense-config-file "%s"' % densify_ini_file,
                "--max-resolution %s" % int(outputs['undist_image_max_size']),
                "--max-threads %s" % args.max_concurrency,
                "--number-views-fuse %s" % number_views_fuse,
                "--sub-resolution-levels %s" % subres_levels,
                "--archive-type 3",
                '-w "%s"' % depthmaps_dir, 
                "-v 0"
            ]

            gpu_config = []
            use_gpu = has_gpu(args)
            if use_gpu:
                gpu_config.append("--cuda-device -1")
            else:
                gpu_config.append("--cuda-device -2")

            extra_config = []

            if args.pc_skip_geometric:
                extra_config.append("--geometric-iters 0")

            masks_dir = os.path.join(tree.opensfm, "undistorted", "masks")
            masks = os.path.exists(masks_dir) and len(os.listdir(masks_dir)) > 0
            if masks:
                extra_config.append("--ignore-mask-label 0")

            with open(densify_ini_file, 'w+') as f:
                f.write("Optimize = 7\n")

            def run_densify():
                system.run('"%s" "%s" %s' % (context.omvs_densify_path, 
                                        openmvs_scene_file,
                                        ' '.join(config + gpu_config + extra_config)))
    gpu_config = []
            use_gpu = has_gpu(args)
            if use_gpu:
                gpu_config.append("--cuda-device -1")

if we has a gpu ,why --cuda-device -1 ? it should be --cuda-device 0 or --cuda-device 1

image

What should be the expected behavior? If this is a feature request, please describe in detail the changes you think should be made to the code, citing files and lines where changes should be made, if possible.

cause we didnot use GPu , want to use Gpu by node-odm correctly

How can we reproduce this? What steps did you do to trigger the problem? If this is an issue with processing a dataset, YOU MUST include a copy of your dataset AND task output log, uploaded on Google Drive or Dropbox (otherwise we cannot reproduce this).

[Type answer here]

github-actions[bot] commented 11 months ago

Could we move this conversation over to the forum at https://community.opendronemap.org? The forum is the right place to ask questions (we try to keep the GitHub issue tracker for feature requests and bugs only). Thank you!

p.s. I'm just an automated script, not a human being.