Skip to content

Commit 560b376

Browse files
committed
Fix cuda context initialization
1 parent 7494259 commit 560b376

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/torchcodec/_core/BetaCudaDeviceInterface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ BetaCudaDeviceInterface::~BetaCudaDeviceInterface() {
152152
}
153153

154154
void BetaCudaDeviceInterface::initializeInterface(AVStream* avStream) {
155+
torch::Tensor dummyTensorForCudaInitialization = torch::empty(
156+
{1}, torch::TensorOptions().dtype(torch::kUInt8).device(device_));
157+
155158
TORCH_CHECK(avStream != nullptr, "AVStream cannot be null");
156159
timeBase_ = avStream->time_base;
157160

0 commit comments

Comments
 (0)