From a41db0ab63f2baf3dec23a27d13a9120e20b5f69 Mon Sep 17 00:00:00 2001 From: Philipp Erler Date: Tue, 1 Oct 2024 13:35:39 +0300 Subject: [PATCH 1/4] test colmap without GPU --- images_to_mesh/processing_steps/sfm/reconstruct.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/images_to_mesh/processing_steps/sfm/reconstruct.py b/images_to_mesh/processing_steps/sfm/reconstruct.py index 284e611..f55bb4c 100644 --- a/images_to_mesh/processing_steps/sfm/reconstruct.py +++ b/images_to_mesh/processing_steps/sfm/reconstruct.py @@ -80,7 +80,8 @@ def reconstruct_with_colmap_sparse(image_list: List[str]) -> List[str]: matching_command = [ 'colmap', 'exhaustive_matcher', '--database_path', database_path, - '--SiftMatching.num_threads', num_processes + '--SiftMatching.num_threads', num_processes, + '--use_gpu', 0 ] try: for line in execute_subprocess(command=matching_command, log_path=log_path, error_path=error_path): @@ -99,7 +100,8 @@ def reconstruct_with_colmap_sparse(image_list: List[str]) -> List[str]: '--database_path', database_path, '--image_path', image_path, '--output_path', sparse_path, - '--Mapper.num_threads', num_processes + '--Mapper.num_threads', num_processes, + '--use_gpu', 0 ] try: for line in execute_subprocess(command=mapping_command, log_path=log_path, error_path=error_path): From 96447d0eec0d2235814646ec16822373dd533b2a Mon Sep 17 00:00:00 2001 From: Philipp Erler Date: Tue, 1 Oct 2024 13:40:47 +0300 Subject: [PATCH 2/4] no GPU for feature extraction too --- images_to_mesh/processing_steps/sfm/reconstruct.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images_to_mesh/processing_steps/sfm/reconstruct.py b/images_to_mesh/processing_steps/sfm/reconstruct.py index f55bb4c..9dd9f54 100644 --- a/images_to_mesh/processing_steps/sfm/reconstruct.py +++ b/images_to_mesh/processing_steps/sfm/reconstruct.py @@ -63,7 +63,8 @@ def reconstruct_with_colmap_sparse(image_list: List[str]) -> List[str]: 'colmap', 'feature_extractor', '--database_path', database_path, '--image_path', image_path, - '--SiftExtraction.num_threads', num_processes + '--SiftExtraction.num_threads', num_processes, + '--use_gpu', 0 ] try: for line in execute_subprocess(command=extract_command, log_path=log_path, error_path=error_path): From c350ec83df6053cdda44ab97ff6507f9ef8a4e09 Mon Sep 17 00:00:00 2001 From: Philipp Erler Date: Sun, 6 Oct 2024 16:59:19 +0200 Subject: [PATCH 3/4] revert last 2 commits, back to GPU usage --- images_to_mesh/processing_steps/sfm/reconstruct.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/images_to_mesh/processing_steps/sfm/reconstruct.py b/images_to_mesh/processing_steps/sfm/reconstruct.py index 9dd9f54..284e611 100644 --- a/images_to_mesh/processing_steps/sfm/reconstruct.py +++ b/images_to_mesh/processing_steps/sfm/reconstruct.py @@ -63,8 +63,7 @@ def reconstruct_with_colmap_sparse(image_list: List[str]) -> List[str]: 'colmap', 'feature_extractor', '--database_path', database_path, '--image_path', image_path, - '--SiftExtraction.num_threads', num_processes, - '--use_gpu', 0 + '--SiftExtraction.num_threads', num_processes ] try: for line in execute_subprocess(command=extract_command, log_path=log_path, error_path=error_path): @@ -81,8 +80,7 @@ def reconstruct_with_colmap_sparse(image_list: List[str]) -> List[str]: matching_command = [ 'colmap', 'exhaustive_matcher', '--database_path', database_path, - '--SiftMatching.num_threads', num_processes, - '--use_gpu', 0 + '--SiftMatching.num_threads', num_processes ] try: for line in execute_subprocess(command=matching_command, log_path=log_path, error_path=error_path): @@ -101,8 +99,7 @@ def reconstruct_with_colmap_sparse(image_list: List[str]) -> List[str]: '--database_path', database_path, '--image_path', image_path, '--output_path', sparse_path, - '--Mapper.num_threads', num_processes, - '--use_gpu', 0 + '--Mapper.num_threads', num_processes ] try: for line in execute_subprocess(command=mapping_command, log_path=log_path, error_path=error_path): From add1b446f92730ef2e882482de7a225565e3656a Mon Sep 17 00:00:00 2001 From: "FancyPille\\PhilippErler" Date: Sun, 6 Oct 2024 20:34:40 +0200 Subject: [PATCH 4/4] fix indentation in docker-compose.yml, explicitly use nvidia docker runtime --- docker-compose.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 21bf8c4..8b80455 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,12 +44,12 @@ services: expose: - "5000" volumes: - - type: bind - target: /usr/src/app/data - source: ${UPLOAD_FOLDER} - - type: bind - target: /usr/src/app/backend_log/ - source: ${BACKEND_LOG} + - type: bind + target: /usr/src/app/data + source: ${UPLOAD_FOLDER} + - type: bind + target: /usr/src/app/backend_log/ + source: ${BACKEND_LOG} networks: - default redis: @@ -75,18 +75,20 @@ services: depends_on: - redis volumes: - - type: bind - target: /usr/src/app/data - source: ${UPLOAD_FOLDER} - - type: bind - target: /usr/src/app - source: . + - type: bind + target: /usr/src/app/data + source: ${UPLOAD_FOLDER} + - type: bind + target: /usr/src/app + source: . command: sh -c "pipenv run rqworker --exception-handler 'images_to_mesh.app.exception_handlers.exeption_handlers.queue_handler' --with-scheduler -u redis://redis:6379" deploy: resources: reservations: devices: - - capabilities: [gpu] + - driver: nvidia + count: all + capabilities: [gpu] networks: - default volumes: