手电筒安装失败:"No space left on device"

Torch installation failure: "No space left on device"

无法重新安装最新的 Torch。克隆新的 repo 并尝试通过执行一系列 make 调用的 install.sh 安装导致:

[ 75%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathCompareTDouble.cu.o
[ 76%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathPointwiseDouble.cu.o
[ 77%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathCompareDouble.cu.o
[ 78%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathReduceDouble.cu.o
[ 80%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMaskedDouble.cu.o
/usr/include/x86_64-linux-gnu/bits/mathcalls.h(234) (col. 12): catastrophic error: error while writing generated C++ file: No space left on device

1 catastrophic error detected in the compilation of "/tmp/tmpxft_0001f39b_00000000-5_THCTensorMaskedDouble.cpp4.ii".
Compilation terminated.
fatbinary fatal   : Could not write file '/tmp/tmpxft_0001efb5_00000000-2_THCTensorMathCompareTHalf.fatbin.c'
CMake Error at THC_generated_THCTensorMathCompareTHalf.cu.o.cmake:267 (message):
  Error generating file
  /local/pavels/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir/generated/./THC_generated_THCTensorMathCompareTHalf.cu.o

/tmp 上 space 不足,这是一台远程机器,所以我没有 sudo 权限来增加它。有什么解决方法吗?基本上我想知道是否有任何方法可以强制 make 将编译文件存储在某个地方而不是 /tmp?

这取决于tmp是什么。

有时,作为一种优化,tmp 被挂载到 ramdisk 中。您可以使用 mount 或在 /etc/fstab.

中查看

如果不是这样,请确保/tmp所在的磁盘分区有足够的空间space,或者删除其他不用的临时文件。

BleachBit,打包在许多发行版中,可以帮助您释放 space。

看来我只需要创建 tmp 目录并将其设置为 TMPDIR 环境变量。

mkdir $HOME/tmp
export TMPDIR=$HOME/tmp