Skip to content

Instantly share code, notes, and snippets.

@aten040791
aten040791 / install-pytorch-with-cuda.md
Created February 3, 2026 09:28 — forked from Hansimov/install-pytorch-with-cuda.md
Install PyTorch with CUDA enabled

Check if CUDA is available by torch:

import torch

def check_cuda():
    print(torch.version.cuda)
    cuda_is_ok = torch.cuda.is_available()
    print(f"CUDA Enabled: {cuda_is_ok}")