1.输入命令
conda install -c conda-forge lua=5.1
得到以下界面:
用helloword进行了测试,说明安装成功。
2.安装torch
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
./install.sh
source ./bashrc
source ./profile
不加;export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"会报错:more than one operator “==” matches these operands.原因在于cuda和torch的头文件都提供了相同的重载运算符,这样编译器在使用的时候就会出现混乱。
解决方法:禁止使用cuda的头文件编译torch