记录一下最近遇到的问题,知道为什么要这么做才知道要做什么,弄明白之后发现自己很蠢,不求甚解的后果就是重复地踩坑。
在Windows10自带的虚拟机上安装了torch,然后运行th %filename%.lua
报错:
Read error: read 0 blocks instead of 1 %file directory% stack traceback:[C]: in function ‘%name%’.
分析
- torch需要cuda,但是cuda在虚拟机上是不可用的,所以相当于根本没有安装成功?但是在命令行中输入
th
可以出现:
- 虚拟机上不能使用cuda,那么只能安装一个Linux双系统,然后花了一天的时间装了个Ubuntu: Windows10安装Ubuntu
- 检查系统是否支持cuda编程的GPU:
lspci | grep -i nvidia
输出:01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)