@@ -93,6 +93,7 @@ ffmpeg -f lavfi -i \
9393```
9494
9595## Installing TorchCodec
96+ ### Installing CPU-only TorchCodec
9697
97981 . Install the latest stable version of PyTorch following the
9899 [ official instructions] ( https://pytorch.org/get-started/locally/ ) . For other
@@ -127,6 +128,46 @@ The following table indicates the compatibility between versions of
127128| not yet supported | ` 2.5 ` | ` >=3.9 ` , ` <=3.12 ` |
128129| ` 0.0.3 ` | ` 2.4 ` | ` >=3.8 ` , ` <=3.12 ` |
129130
131+ ### Installing CUDA-enabled TorchCodec
132+
133+ First, make sure you have a GPU that has NVDEC hardware that can decode the
134+ format you want. Refer to Nvidia's GPU support matrix for more details
135+ [ here] ( https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new ) .
136+
137+ 1 . Install CUDA Toolkit. Pytorch and TorchCodec supports CUDA Toolkit
138+ versions 11.8, 12.1 or 12.4. In particular TorchCodec depends on
139+ CUDA libraries libnpp and libnvrtc.
140+
141+ 2 . Install Pytorch that corresponds to your CUDA Toolkit version using the
142+ [ official instructions] ( https://pytorch.org/get-started/locally/ ) .
143+
144+ 3 . Install or compile FFmpeg with NVDEC support.
145+ TorchCodec with CUDA should work with FFmpeg versions in [ 4, 7] .
146+
147+ If FFmpeg is not already installed, or you need a more recent version, an
148+ easy way to install it is to use ` conda ` :
149+
150+ ``` bash
151+ conda install ffmpeg
152+ # or
153+ conda install ffmpeg -c conda-forge
154+ ```
155+
156+ If you are building FFmpeg from source you can follow Nvidia's guide to
157+ configuring and installing FFmpeg with NVDEC support
158+ [ here] ( https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html ) .
159+
160+ 4 . Install TorchCodec by passing in an ` --index-url ` parameter that corresponds to your CUDA
161+ Toolkit version, example:
162+
163+ ``` bash
164+ # This corresponds to CUDA Toolkit version 12.4
165+ pip install torchcodec --index-url=https://download.pytorch.org/whl/nightly/cu124
166+ ```
167+
168+ Note that without passing in the ` --index-url ` parameter, ` pip ` installs TorchCodec
169+ binaries from PyPi which are CPU-only and do not have CUDA support.
170+
130171## Benchmark Results
131172
132173The following was generated by running [ our benchmark script] ( ./benchmarks/decoders/generate_readme_data.py ) on a lightly loaded 56-core machine.
0 commit comments