最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

安裝Ubuntu20.04與安裝NVIDIA驅(qū)動的教程

 更新時間:2020年05月20日 10:58:30   作者:看官請坐好  
這篇文章主要介紹了安裝Ubuntu20.04,安裝NVIDIA驅(qū)動的相關(guān)知識,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

安裝Ubuntu 20.04 安裝NVIDIA 驅(qū)動 配置Pytouch 和tensorflow環(huán)境

本機環(huán)境:戴爾G3 3579
win10 ,系統(tǒng)在128固態(tài)硬盤

安裝Ubuntu20.04

1開機按F2進入BIOS
2 security boot 設(shè)置disable
3 參考
http://www.fzitv.net/article/173277.htm

在這里插入圖片描述

安裝NVIDIA驅(qū)動

最開始安裝驅(qū)動,首先禁止nouveau
然后卸載原先的nvidia驅(qū)動(如果有)
參考:
http://www.fzitv.net/article/171959.htm
但是裝完出現(xiàn)這種情況
nvidia-smi有輸出,nvidia-settings有反映,而且還生成了快捷圖標
但是重啟生效后,在設(shè)置->關(guān)于:顯卡由原來的集成顯卡630變成了lvib什么的
雖然不影響審定學習環(huán)境搭建但是總感覺以后會掛的
還有一種情況是 ,裝完成驅(qū)動后,在設(shè)置->關(guān)于:顯卡顯示GTX1060。但是每次開機或者關(guān)機顯示:dev/sda5 clean …dev/sda6 clean.等2s后關(guān)機,開機也是這樣。
還有一種情況是,環(huán)境搭建好了,驅(qū)動什么的都好了,但是一個命令,當時在安裝網(wǎng)易云音月,要弄什么依賴,然后一行命令過去,開機無限閃現(xiàn)dev/sda6 clean 。ctro-alt-f1能打開tty,但是用戶名和密碼來不及輸入,tty閃退,1s不到。然后進不了系統(tǒng)。最后重裝系統(tǒng)
現(xiàn)在:
裝完ubuntu系統(tǒng)后,什么更新都不要,也不要禁止nouveau。第一件事情直接裝驅(qū)動,

在這里插入圖片描述

重啟后,麻事情沒有。

搭建pytouch

安裝miniconda3,
換中科大,清華源
conda create -n pytouch python=3.7
conda activate pytouch
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda install pytorch=0.4.1 torchvision cuda90

安裝pycharm

在這里插入圖片描述

點擊tools->create desktop entry 直接生成快捷鍵
設(shè)置編譯器為pytouch
填寫代碼測試使用了GPU:

import torch
flag = torch.cuda.is_available()
print(flag)

ngpu= 1
# Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
print(torch.rand(3,3).cuda()) 
# True
# cuda:0
# GeForce GTX 1060
# tensor([[0.5772, 0.5287, 0.0946],
#  [0.9525, 0.7855, 0.1391],
#  [0.6858, 0.5143, 0.8188]], device='cuda:0')

安裝tensorflow14

import tensorflow as tf
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
import warnings
warnings.filterwarnings("ignore")
hello=tf.constant("Hello,Tensorflow")
print(hello)
a=tf.constant([1.0,2.0]) #定義常數(shù)
b=tf.constant([3.4,4.0])
result1=a+b
print("a+b=",result1)
c=tf.constant([[3.0],[1.4]])
result2=a+c
sess=tf.Session()
print("result1:",result1)#顯示結(jié)果是“add:0"的張量,shape只有一個元素,即維度是1
# 2表示第一個維度有兩個元素,且是浮點型
try:
 print(sess.run(result1))
 print("result2:",result2)
 print(sess.run(result2))
 print(sess.run(hello))
except:
 #異常處理
 print("Exception")
finally:
 #關(guān)閉會話,釋放資源
 sess.close()

在這里插入圖片描述

總結(jié)

到此這篇關(guān)于安裝Ubuntu20.04與安裝NVIDIA驅(qū)動的教程的文章就介紹到這了,更多相關(guān)安裝Ubuntu20.04 NVIDIA驅(qū)動內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論

怀来县| 武山县| 当涂县| 塔城市| 株洲市| 肥乡县| 壶关县| 武陟县| 五指山市| 绵阳市| 托里县| 襄城县| 乐山市| 宜兴市| 雷州市| 翁牛特旗| 荃湾区| 都匀市| 寻乌县| 庄河市| 淮滨县| 杂多县| 绥宁县| 禹州市| 浦县| 平果县| 刚察县| 石渠县| 达孜县| 寿光市| 广南县| 荆门市| 安国市| 平谷区| 讷河市| 雅江县| 黄梅县| 宕昌县| 沁水县| 美姑县| 义马市|