Skip to content

Commit

Permalink
[fbsync] Fix compile with nvjpeg on Windows CUDA 12 (#8641)
Browse files Browse the repository at this point in the history
Reviewed By: vmoens

Differential Revision: D62581682

fbshipit-source-id: 40ee1636bb1608da92b1fc258634d26c88a430fd
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Sep 13, 2024
1 parent fe6948c commit d8abd5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def make_image_extension():
else:
warnings.warn("Building torchvision without AVIF support")

if USE_NVJPEG and torch.cuda.is_available():
if USE_NVJPEG and (torch.cuda.is_available() or FORCE_CUDA):
nvjpeg_found = CUDA_HOME is not None and (Path(CUDA_HOME) / "include/nvjpeg.h").exists()

if nvjpeg_found:
Expand All @@ -376,6 +376,8 @@ def make_image_extension():
Extension = CUDAExtension
else:
warnings.warn("Building torchvision without NVJPEG support")
elif USE_NVJPEG:
warnings.warn("Building torchvision without NVJPEG support")

return Extension(
name="torchvision.image",
Expand Down

0 comments on commit d8abd5f

Please sign in to comment.