编译-链接-运行-环境配置各种error汇总
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改成具體進程中包含的關鍵字,注意不要有空格。
總結
以上是生活随笔為你收集整理的编译-链接-运行-环境配置各种error汇总的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 常用图像格式(PNG,JPG)到SGI图
- 下一篇: Linux 常用技巧记录