Skip to content

Commit 79c3934

Browse files
authored
Better error message when FFmpeg doesn't support CUDA (#499)
1 parent 2ecf666 commit 79c3934

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/torchcodec/decoders/_core/CudaDevice.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,14 @@ AVBufferRef* getFFMPEGContextFromExistingCudaContext(
9898
nullptr,
9999
AV_CUDA_USE_CURRENT_CONTEXT);
100100
if (err < 0) {
101+
/* clang-format off */
101102
TORCH_CHECK(
102103
false,
103-
"Failed to create specified HW device",
104-
getFFMPEGErrorStringFromErrorCode(err));
104+
"Failed to create specified HW device. This typically happens when ",
105+
"your installed FFmpeg doesn't support CUDA (see ",
106+
"https://github.com/pytorch/torchcodec#installing-cuda-enabled-torchcodec",
107+
"). FFmpeg error: ", getFFMPEGErrorStringFromErrorCode(err));
108+
/* clang-format on */
105109
}
106110
return hw_device_ctx;
107111
}

0 commit comments

Comments
 (0)