[Python] Pytorch fails with CUDA error: device-side assert triggered on Colab

Discussão em 'Python' iniciado por Stack, Dezembro 18, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to initialize a tensor on Google Colab with GPU enabled.

    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

    t = torch.tensor([1,2], device=device)


    But I am getting this strange error.

    RuntimeError: CUDA error: device-side assert triggered
    CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
    For debugging consider passing CUDA_LAUNCH_BLOCKING=1


    Even by setting that environment variable to 1 seems not showing any further details.
    Anyone ever had this issue?

    Continue reading...

Compartilhe esta Página