标签:uninstall 查询 sign The 渲染 copyright uid 准备 mod
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
---
说明:
正文:
命令:
# 如下命令用来定义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://blog.csdn.net/qq_37163122/article/details/78169072
原理:默认ubuntu系统安装后有ssh,而没有sshd,所以其他服务器要通过ssh链接ubuntu需要如下
```
安装指导: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 #查询服务状态
```
Best way is use ‘WEBQQ‘, it‘s an URL, you can make a URL link icon on ubuntu desktop!.
DONOT DOUBLE CLICK ‘deb‘ file in dialog and it will NOT install chrome and final create a icon of it(it seems not install finished indeed!)!
其次参照如下链接,配置Project Interperter;因为一般有多个python,比如pycharm自带,ananconda如果你安装了,系统的python3或2如果你安装了,我选系统python3作为解析其),你选了哪个,pycharm会自动探测其依赖库的更新,一般ananconda好. https://www.cnblogs.com/fanmu/p/8010580.html
解决:其实只要你sudo apt-get install A,B,C,D,E //将循环依赖库一并写上就可!
TODO:暂未找到ubuntu18.04的调节鼠标大小的方法和命令;
# 查看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)
3.安装cuda9.1/CUDA9.0/CUDA较高版本(cuda安装包提示最高支持ubuntu17.10,别管它,其实我18.04照样安装!没事!)
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
释放后做些拷贝和路径设定就行,参考以上CUDA的神贴,较简单.
问题:一般你会遇到结果提示,Box2D和atari-py安装失败,重复上述命令,再次安装全部gym[all],就更清晰的看到只有此2模块没有安装成功(和win10一致);
安装成功后,如下测试:
测试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关闭,只能用本行命令关闭!
2018-05-11-机器学习环境安装-I7-GTX960M-UBUNTU1804-CUDA90-CUDNN712-TF180-KERAS-GYM-ATARI-BOX2D
标签:uninstall 查询 sign The 渲染 copyright uid 准备 mod
原文地址:https://www.cnblogs.com/taichu/p/9031315.html