@@ -1672,22 +1672,27 @@ def test_beta_cuda_interface_cpu_fallback(self):
16721672 # to the CPU path, too.
16731673
16741674 ref_dec = VideoDecoder (H265_VIDEO .path , device = "cuda" )
1675- ref_frames = ref_dec .get_frame_at (0 )
1676- assert (
1677- _core ._get_backend_details (ref_dec ._decoder )
1678- == "FFmpeg CUDA Device Interface. Using CPU fallback."
1679- )
1675+
1676+ # Before accessing any frames, status should be unknown
1677+ assert not ref_dec .cpu_fallback .status_known
1678+
1679+ ref_frame = ref_dec .get_frame_at (0 )
1680+
1681+ assert "FFmpeg CUDA" in str (ref_dec .cpu_fallback )
1682+ assert ref_dec .cpu_fallback .status_known
1683+ assert bool (ref_dec .cpu_fallback )
16801684
16811685 with set_cuda_backend ("beta" ):
16821686 beta_dec = VideoDecoder (H265_VIDEO .path , device = "cuda" )
16831687
1684- assert (
1685- _core ._get_backend_details (beta_dec ._decoder )
1686- == "Beta CUDA Device Interface. Using CPU fallback."
1687- )
1688+ assert "Beta CUDA" in str (beta_dec .cpu_fallback )
1689+ # For beta interface, status is known immediately
1690+ assert beta_dec .cpu_fallback .status_known
1691+ assert bool (beta_dec .cpu_fallback )
1692+
16881693 beta_frame = beta_dec .get_frame_at (0 )
16891694
1690- assert psnr (ref_frames .data , beta_frame .data ) > 25
1695+ assert psnr (ref_frame .data , beta_frame .data ) > 25
16911696
16921697 @needs_cuda
16931698 def test_beta_cuda_interface_error (self ):
@@ -1715,7 +1720,8 @@ def test_set_cuda_backend(self):
17151720 # Check that the default is the ffmpeg backend
17161721 assert _get_cuda_backend () == "ffmpeg"
17171722 dec = VideoDecoder (H265_VIDEO .path , device = "cuda" )
1718- assert _core ._get_backend_details (dec ._decoder ).startswith ("FFmpeg CUDA" )
1723+ _ = dec .get_frame_at (0 )
1724+ assert "FFmpeg CUDA" in str (dec .cpu_fallback )
17191725
17201726 # Check the setting "beta" effectively uses the BETA backend.
17211727 # We also show that the affects decoder creation only. When the decoder
@@ -1724,9 +1730,9 @@ def test_set_cuda_backend(self):
17241730 with set_cuda_backend ("beta" ):
17251731 dec = VideoDecoder (H265_VIDEO .path , device = "cuda" )
17261732 assert _get_cuda_backend () == "ffmpeg"
1727- assert _core . _get_backend_details ( dec . _decoder ). startswith ( "Beta CUDA" )
1733+ assert "Beta CUDA" in str ( dec . cpu_fallback )
17281734 with set_cuda_backend ("ffmpeg" ):
1729- assert _core . _get_backend_details ( dec . _decoder ). startswith ( "Beta CUDA" )
1735+ assert "Beta CUDA" in str ( dec . cpu_fallback )
17301736
17311737 # Hacky way to ensure passing "cuda:1" is supported by both backends. We
17321738 # just check that there's an error when passing cuda:N where N is too
@@ -1762,23 +1768,6 @@ def test_cpu_fallback_h265_video_ffmpeg_cuda(self):
17621768 assert bool (decoder .cpu_fallback )
17631769 assert "Fallback status: Falling back due to:" in str (decoder .cpu_fallback )
17641770
1765- @needs_cuda
1766- def test_cpu_fallback_h265_video_beta_cuda (self ):
1767- """Test that H265 video triggers CPU fallback on Beta CUDA interface."""
1768- with set_cuda_backend ("beta" ):
1769- decoder = VideoDecoder (H265_VIDEO .path , device = "cuda" )
1770-
1771- # Before accessing any frames, status should be unknown
1772- assert decoder .cpu_fallback .status_known
1773-
1774- _ = decoder .get_frame_at (0 )
1775-
1776- # After accessing frames, status should be known
1777- assert decoder .cpu_fallback .status_known
1778-
1779- assert bool (decoder .cpu_fallback )
1780- assert "Fallback status: Falling back due to:" in str (decoder .cpu_fallback )
1781-
17821771 @needs_cuda
17831772 def test_cpu_fallback_no_fallback_on_supported_video (self ):
17841773 """Test that supported videos don't trigger fallback on CUDA."""
0 commit comments