Skip to content

Commit 895cf2a

Browse files
committed
Revert "[torchcodec] Add support for Nvidia GPU Decoding (#137)"
This reverts commit 8fee167.
1 parent f3c8a05 commit 895cf2a

18 files changed

+26
-403
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
cmake_minimum_required(VERSION 3.18)
22
project(TorchCodec)
33

4-
option(ENABLE_CUDA "Enable CUDA decoding using NVDEC" OFF)
5-
option(ENABLE_NVTX "Enable NVTX annotations for profiling" OFF)
6-
74
add_subdirectory(src/torchcodec/decoders/_core)
85

96

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,3 @@ guide](CONTRIBUTING.md) for more details.
140140
## License
141141

142142
TorchCodec is released under the [BSD 3 license](./LICENSE).
143-
144-
145-
If you are building with ENABLE_CUDA and/or ENABLE_NVTX please review
146-
[Nvidia licenses](https://docs.nvidia.com/cuda/eula/index.html).

benchmarks/decoders/BenchmarkDecodersMain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ void runNDecodeIterationsWithCustomOps(
145145
/*height=*/std::nullopt,
146146
/*thread_count=*/std::nullopt,
147147
/*dimension_order=*/std::nullopt,
148-
/*stream_index=*/std::nullopt,
149-
/*device_string=*/std::nullopt);
148+
/*stream_index=*/std::nullopt);
150149

151150
for (double pts : ptsList) {
152151
seekFrameOp.call(decoderTensor, pts);

benchmarks/decoders/gpu_benchmark.py

Lines changed: 0 additions & 101 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,12 @@ def _build_all_extensions_with_cmake(self):
112112
torch_dir = Path(torch.utils.cmake_prefix_path) / "Torch"
113113
cmake_build_type = os.environ.get("CMAKE_BUILD_TYPE", "Release")
114114
python_version = sys.version_info
115-
enable_cuda = os.environ.get("ENABLE_CUDA", "")
116-
enable_nvtx = os.environ.get("ENABLE_NVTX", "")
117115
cmake_args = [
118116
f"-DCMAKE_INSTALL_PREFIX={self._install_prefix}",
119117
f"-DTorch_DIR={torch_dir}",
120118
"-DCMAKE_VERBOSE_MAKEFILE=ON",
121119
f"-DCMAKE_BUILD_TYPE={cmake_build_type}",
122120
f"-DPYTHON_VERSION={python_version.major}.{python_version.minor}",
123-
f"-DENABLE_CUDA={enable_cuda}",
124-
f"-DENABLE_NVTX={enable_nvtx}",
125121
]
126122

127123
Path(self.build_temp).mkdir(parents=True, exist_ok=True)

src/torchcodec/decoders/_core/CMakeLists.txt

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@ set(CMAKE_CXX_STANDARD 17)
44
set(CMAKE_CXX_STANDARD_REQUIRED ON)
55

66
find_package(Torch REQUIRED)
7-
8-
if(ENABLE_CUDA)
9-
find_package(CUDA REQUIRED)
10-
11-
if(ENABLE_NVTX)
12-
# We only need CPM for NVTX:
13-
# https://github.com/NVIDIA/NVTX#cmake
14-
file(
15-
DOWNLOAD
16-
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.38.3/CPM.cmake
17-
${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake
18-
EXPECTED_HASH SHA256=cc155ce02e7945e7b8967ddfaff0b050e958a723ef7aad3766d368940cb15494
19-
)
20-
include(${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake)
21-
CPMAddPackage(
22-
NAME NVTX
23-
GITHUB_REPOSITORY NVIDIA/NVTX
24-
GIT_TAG v3.1.0-c-cpp
25-
GIT_SHALLOW TRUE)
26-
endif()
27-
endif()
28-
297
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
308
find_package(Python3 ${PYTHON_VERSION} EXACT COMPONENTS Development)
319

@@ -41,12 +19,6 @@ function(make_torchcodec_library library_name ffmpeg_target)
4119
)
4220
add_library(${library_name} SHARED ${sources})
4321
set_property(TARGET ${library_name} PROPERTY CXX_STANDARD 17)
44-
if(ENABLE_CUDA)
45-
target_compile_definitions(${library_name} PRIVATE ENABLE_CUDA=1)
46-
endif()
47-
if(ENABLE_NVTX)
48-
target_compile_definitions(${library_name} PRIVATE ENABLE_NVTX=1)
49-
endif()
5022

5123
target_include_directories(
5224
${library_name}
@@ -56,17 +28,12 @@ function(make_torchcodec_library library_name ffmpeg_target)
5628
${Python3_INCLUDE_DIRS}
5729
)
5830

59-
set(NEEDED_LIBRARIES ${ffmpeg_target} ${TORCH_LIBRARIES} ${Python3_LIBRARIES})
60-
if(ENABLE_CUDA)
61-
list(APPEND NEEDED_LIBRARIES ${CUDA_CUDA_LIBRARY})
62-
endif()
63-
if(ENABLE_NVTX)
64-
list(APPEND NEEDED_LIBRARIES nvtx3-cpp)
65-
endif()
6631
target_link_libraries(
6732
${library_name}
6833
PUBLIC
69-
${NEEDED_LIBRARIES}
34+
${ffmpeg_target}
35+
${TORCH_LIBRARIES}
36+
${Python3_LIBRARIES}
7037
)
7138

7239
# We already set the library_name to be libtorchcodecN, so we don't want

src/torchcodec/decoders/_core/FFMPEGCommon.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ using UniqueAVFilterInOut = std::unique_ptr<
5757
Deleterp<AVFilterInOut, void, avfilter_inout_free>>;
5858
using UniqueAVIOContext = std::
5959
unique_ptr<AVIOContext, Deleterp<AVIOContext, void, avio_context_free>>;
60-
using UniqueAVBufferRef =
61-
std::unique_ptr<AVBufferRef, Deleterp<AVBufferRef, void, av_buffer_unref>>;
6260

6361
// av_find_best_stream is not const-correct before commit:
6462
// https://github.com/FFmpeg/FFmpeg/commit/46dac8cf3d250184ab4247809bc03f60e14f4c0c

0 commit comments

Comments
 (0)