Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.
This repository was archived by the owner on May 15, 2023. It is now read-only.

RuntimeError: CUDA error: invalid device ordinal #1

@kazuma0606

Description

@kazuma0606

Hi,

In google Collaboratory, the following comment appears and train.py does not work.
----------------- End -------------------
Traceback (most recent call last):
File "train.py", line 15, in
opt = TrainOptions().parse()
File "/content/drive/My Drive/Colab Notebooks/3D_CycleGAN_Project/3D-CycleGan-Pytorch-MedImaging/options/base_options.py", line 109, in parse
torch.cuda.set_device(opt.gpu_ids[0])
File "/usr/local/lib/python3.7/dist-packages/torch/cuda/init.py", line 264, in set_device
torch._C._cuda_setDevice(device)
RuntimeError: CUDA error: invalid device ordinal
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.

Do you know of a better way?

Enviroments:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Wed_Jul_22_19:09:09_PDT_2020
Cuda compilation tools, release 11.0, V11.0.221
Build cuda_11.0_bu.TC445_37.28845127_0

Cheers,
Hisanori Yoshimura
E-mail: [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions