def test_video_decode_cuda_works(self):
        """Both CPU and GPU decoding should work on a GPU-enabled machine."""
        valid_url = "https://marqo-k400-video-test-dataset.s3.amazonaws.com/videos/--_S9IDQPLg_000135_000145.mp4"
        start_time = 0
        duration = 10

        for enable_video_gpu_acceleration in (True, False):
            streaming_media_processor_object = StreamingMediaProcessor(
                url=valid_url, preprocessors=self.test_preprocessor,
                preprocessing_config=self.test_video_preprocessing_config,
                enable_video_gpu_acceleration=enable_video_gpu_acceleration
            )

            decode_start_time = time.time()

            streaming_media_processor_object.fetch_video_chunk(
                start_time, duration, self.output_file
            )
            elapsed_time = time.time() - decode_start_time

            # We expect the GPU decoding to be faster than CPU decoding
            if enable_video_gpu_acceleration:
                self.assertLess(
                    elapsed_time, 3, f"GPU decoding took too long. Elapsed time: "
                                     f"{elapsed_time}. URL: {valid_url}"
                )
            self.assertTrue(os.path.exists(self.output_file))
Both CPU and GPU decoding should work on a GPU-enabled machine.
tests/integ_tests/inference/native_inference/media_download_and_preprocess/test_streaming_media_preprcessor.py