File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed
Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -114,9 +114,16 @@ def _detect_optional_features(cls) -> None:
114114 """Detect other optional features and accelerators."""
115115 # GPU support via CuPy
116116 try :
117- import_module ("cuda" )
118- cls ._config ["available_features" ].add ("gpu_cupy" )
119- except ImportError :
117+ warnings .filterwarnings (
118+ "ignore" ,
119+ message = "CUDA path could not be detected" ,
120+ category = UserWarning ,
121+ module = r"cupy\._environment" ,
122+ )
123+ cp = import_module ("cupy" )
124+ if cp .cuda .runtime .getDeviceCount () > 0 :
125+ cls ._config ["available_features" ].add ("gpu_cupy" )
126+ except (ImportError , Exception ):
120127 pass
121128
122129 # GPU support via PyTorch
Original file line number Diff line number Diff line change @@ -185,6 +185,15 @@ def to_tensor(a):
185185
186186# CUDA backend (only if cupy is available)
187187try :
188+ import warnings
189+
190+ # Suppress CuPy CUDA path warning during availability check
191+ warnings .filterwarnings (
192+ "ignore" ,
193+ message = "CUDA path could not be detected" ,
194+ category = UserWarning ,
195+ module = r"cupy\._environment" ,
196+ )
188197 import cupy as cp # noqa: F401
189198
190199 CUPY_AVAILABLE = True
Original file line number Diff line number Diff line change 1414from pyflowreg .motion_correction .OF_options import OutputFormat , ChannelNormalization
1515
1616# Import to trigger executor registration (side effect)
17+ import pyflowreg .motion_correction .parallelization as _parallelization # noqa: F401
1718
1819
1920@dataclass
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def initialize_runtime_context():
2525 RuntimeContext .init (force = True )
2626
2727 # Import parallelization module to trigger executor registration
28+ import pyflowreg .motion_correction .parallelization # noqa: F401
2829
2930
3031@pytest .fixture (scope = "function" )
You can’t perform that action at this time.
0 commit comments