当使用 torch cuda 脚本被杀死

问题描述 投票:0回答:0

我正在使用具有 GPU 的 Jetson Nano 设备。

>>> import torch
>>> import torchvision
>>> torch.__version__
'1.8.0'
>>> torchvision.__version__
'0.9.0a0+01dfa8e'
>>> torch.cuda.is_available()
True
>>> torch.cuda.device_count()
1
>>> torch.cuda.current_device()
0
>>> torch.cuda.get_device_name(0)
'NVIDIA Tegra X1'
>>> torch.cuda.memory_allocated(0)
0
>>> torch.cuda.memory_reserved(0)
0
>>> torch.cuda.max_memory_reserved(0)
0
>>> torch.cuda.max_memory_allocated(0)
0

问题是当我使用方法 .to(device) 脚本被杀死

>>> torch.rand(3)
tensor([0.6947, 0.2633, 0.7335])
>>> device = torch.device(0 if (torch.cuda.is_available()) else "cpu")
>>> device
device(type='cuda', index=0)
>>> torch.rand(3).to(device)

被杀

当我检查 dmesg

[3482376.053248] 内存不足:杀死进程 19544(python)得分 247 或牺牲孩子 [3482376.067301] 终止进程 19544 (python) total-vm:11339744kB, anon-rss:1200112kB, file-rss:303524kB, shmem-rss:0kB

旁注:我的内存中有 17GB 可用空间。

请指教

python torch pycuda nvidia-jetson-nano
© www.soinside.com 2019 - 2024. All rights reserved.