专栏算法工具链在GPU docker 环境下运行模型训练时CUDA error

在GPU docker 环境下运行模型训练时CUDA error

已解决
默认937922024-12-14
59
3

您好,

 

在OE J6E GPU Docker 环境下, 按 Horizon Torch Samples 做QAT 训练时,出现如下错误:

 

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. Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

 

详细错误记录请看附件。

-----------------------------------------------------------------------------

 

在同一环境下检查

结果为 真

 

运行

>>> import torch

>>> print(torch.rand(2,3).cuda())

可输出

tensor([[0.0229, 0.4223, 0.2337], [0.4514, 0.2438, 0.6422]], device='cuda:0')

 

 

 

 

附件:
算法工具链
征程6
评论2
0/1000
  • Huanghui
    Lv.5

    收到!

    2024-12-14
    0
    0
  • Huanghui
    Lv.5

    是不是设置的用于训练的 GPU 设备编号超出了当前环境实际可用的 GPU 设备范围。比如,系统只有 4 块 GPU(设备编号为 0 - 3),但代码里却指定了设备编号为 5 的 GPU 来运行任务。检查一下呢

    2024-12-14
    0
    1
    • 默认93792回复Huanghui:

      是的,谢谢

      2024-12-15
      1