在 ~/.bashrc 里再设置一下cuda的环境变量:
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
同时 source ~/.bashrc 让其生效。
原文:https://www.cnblogs.com/wind-chaser/p/11338663.html