@@ -427,59 +427,6 @@ def get_extensions():
427427 )
428428 )
429429
430- # Locating video codec
431- # CUDA_HOME should be set to the cuda root directory.
432- # TORCHVISION_INCLUDE and TORCHVISION_LIBRARY should include the location to
433- # video codec header files and libraries respectively.
434- video_codec_found = (
435- extension is CUDAExtension
436- and CUDA_HOME is not None
437- and any ([os .path .exists (os .path .join (folder , "cuviddec.h" )) for folder in vision_include ])
438- and any ([os .path .exists (os .path .join (folder , "nvcuvid.h" )) for folder in vision_include ])
439- and any ([os .path .exists (os .path .join (folder , "libnvcuvid.so" )) for folder in library_dirs ])
440- )
441-
442- print (f"video codec found: { video_codec_found } " )
443-
444- if (
445- video_codec_found
446- and has_ffmpeg
447- and any ([os .path .exists (os .path .join (folder , "libavcodec" , "bsf.h" )) for folder in ffmpeg_include_dir ])
448- ):
449- gpu_decoder_path = os .path .join (extensions_dir , "io" , "decoder" , "gpu" )
450- gpu_decoder_src = glob .glob (os .path .join (gpu_decoder_path , "*.cpp" ))
451- cuda_libs = os .path .join (CUDA_HOME , "lib64" )
452- cuda_inc = os .path .join (CUDA_HOME , "include" )
453-
454- ext_modules .append (
455- extension (
456- "torchvision.Decoder" ,
457- gpu_decoder_src ,
458- include_dirs = include_dirs + [gpu_decoder_path ] + [cuda_inc ] + ffmpeg_include_dir ,
459- library_dirs = ffmpeg_library_dir + library_dirs + [cuda_libs ],
460- libraries = [
461- "avcodec" ,
462- "avformat" ,
463- "avutil" ,
464- "swresample" ,
465- "swscale" ,
466- "nvcuvid" ,
467- "cuda" ,
468- "cudart" ,
469- "z" ,
470- "pthread" ,
471- "dl" ,
472- ],
473- extra_compile_args = extra_compile_args ,
474- )
475- )
476- else :
477- print (
478- "The installed version of ffmpeg is missing the header file 'bsf.h' which is "
479- "required for GPU video decoding. Please install the latest ffmpeg from conda-forge channel:"
480- " `conda install -c conda-forge ffmpeg`."
481- )
482-
483430 return ext_modules
484431
485432
0 commit comments