1.cmake时查找到anoconda的lib
在cmake时常常系统的lib会跟anoconda里面的lib有冲突,cmake找到anoconda中的lib时会导致make error, 特别如libtiff.so此类的库。
网上大多数教程是在~/.bashrc或/etc/profile中注释掉export 的 anoconda path:
1、 sudo gedit ~/.bashrc
2、 注释掉export anoconda一行
3、source ~/.bashrc
但是这个办法对我不起作用在终端中输入echo $PATH 发现anoconda的路径还在。
所以我的解决办法是直接在终端中执行PATH=(echo $PATH的输出删掉anoconda路径),之后便可以正常cmake和make了。
2.opencv运行时出错
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
终端输入,打印出错
export QT_DEBUG_PLUGINS=1
我这里是因为anaconda3的qt库,跟我安装的qt库冲突了,所以我把anaconda/lib/python3.8/site-packages/cv2/qt 目录随便改了一个名字。
3.nvcc -V与cat /usr/local/cuda/version.txt cuda版本不一致
1.先卸载旧的
sudo apt-get autoremove nvidia-cuda-toolkit
2.查看/usr/local/cuda/bin下是否有nvcc可执行程序,如果没有说明cuda没有正常安装,需要重新安装,如果有,进入下一步
输入sudo gedit ./.bashrc 打开~/.bashrc ,添加环境变量 export PATH="/usr/local/cuda/bin:$PATH"
4.显卡驱动版本和CUDA版本对应关系
5.linux kill批量杀掉指定进程
有些进程异常终止时,还占用GPU内存,需要手动停止它。
ps -ef|grep train.py|grep -v grep|cut -c 9-15|xargs kill -9
这里的train.py改成具体进程中包含的关键字,注意不要有空格。