layout: post
title: 2018-05-11-機器學習環境安裝-I7-GTX960M-UBUNTU1804-CUDA90-CUDNN712-TF180-KERAS-GYM-ATARI-BOX2D
key: 20180511
tags: 機器學習 cuda cudnn tensorflow gym
modify_date: 05-11
---html
說明:python
正文:linux
# 查看N卡GPU的配置 nvidia-smi # 查看N卡的圖形界面配置 nvidia-settings # 命令:查看nvidia卡型號; $ lspci | grep -i nvidia # 返回內容: 01:00.0 VGA compatible controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
A.執行cuda9.X的run安裝文件出現問題 Error: unsupported compiler: 7.3.0. Use --override to override this check. sudo sh ./cuda_9.1.85_387.26_linux.run --override //添加這個參數來屏蔽這個報錯! 因而能夠繼續安裝了! 看到以下結果,基本OK. = Summary = =========== Driver: Not Selected Toolkit: Installed in /usr/local/cuda-9.1 Samples: Installed in /home/ya/cuda9-samples Please make sure that - PATH includes /usr/local/cuda-9.1/bin - LD_LIBRARY_PATH includes /usr/local/cuda-9.1/lib64, or, add /usr/local/cuda-9.1/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-9.1/bin Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-9.1/doc/pdf for detailed information on setting up CUDA. WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 9.1 functionality to work. To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file: sudo <CudaInstaller>.run -silent -driver Logfile is /tmp/cuda_install_13322.log Signal caught, cleaning up --------------------- B 設定配置(參照上面提示) $ sudo vim /etc/profile 在打開的文件末尾,添加如下兩行。 64位系統: $ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} 32位系統: $ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} $ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} C 安裝完畢CUDA9.x,還需安裝以下lib sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev D 最後reboot,並用以下命令測試,看是否安裝CUDA9.X正確 $ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA Corporation Built on Fri_Nov__3_21:07:56_CDT_2017 Cuda compilation tools, release 9.1, V9.1.85
測試Box2D物理引擎是經過激活以下的小遊戲CartPole: 用以下命令來測試Box2D是否安裝成功,若是失敗,只會出現白框,而沒有杆子! python //進入python,最好是PY3 import gym //load gym庫,這裏不能有報錯 env = gym.make("CartPole-v0") //新建一個樹立杆子的遊戲環境 env.reset() //初始化 env.render() //渲染,此時會彈出dialog,裏面有杆子!就算OK了! env.close() //關閉env環境,dialog不能被gui關閉,只能用本行命令關閉!
測試: python //進入python,最好是PY3 import gym //load gym庫,這裏不能有報錯 env = gym.make("SpaceInvaders-v0") //新建一個打飛機遊戲環境(這裏可能會報錯以下!!!) env.reset() //初始化 env.render() //渲染,此時會彈出dialog,裏面有飛機!就算OK了! env.close() //關閉env環境,dialog不能被gui關閉,只能用本行命令關閉!
請參考持續收集的項目computer-using-hints, 及源碼git
命令:github
# 以下命令用來定義2種python sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150 # 以下命令用來切換 sudo update-alternatives --config python
安裝指導:https://jingyan.baidu.com/article/359911f5a5b74857fe0306c4.html 首先看看本身的Ubuntu是否是已經安裝或啓用了ssh服務,執行ps -e |grep ssh 若是隻有ssh-agent 這個是ssh-client客戶端服務,若是沒有sshd,繼續以下安裝ssh-server 安裝sshd: sudo apt install openssh-server 手動操做開啓/關閉ssh服務相關命令: sudo service ssh start #手動啓動服務 sudo service ssh stop #手動關閉服務 sudo service ssh status #查詢服務狀態