当前位置:网站首页>GPU, CUDA,cuDNN三者的關系總結
GPU, CUDA,cuDNN三者的關系總結
2022-04-23 11:17:00 【挽手等風起】
GPU, CUDA,cuDNN三者的關系總結
CPU 和 GPU
cpu和gpu結構展示
GPU(圖像處理器,Graphics Processing Unit)和CPU(中央處理器,Central Processing Unit)在設計上的主要差异在於GPU有更多的運算單元(如圖中綠色的ALU),而Control和Cache單元不如CPU多,這是因為GPU在進行並行計算的時候每個運算單元都是執行相同的程序,而不需要太多的控制。Cache單元是用來做數據緩存的,CPU可以通過Cache來减少存取主內存的次數,也就是减少內存延遲(memory latency)。GPU中Cache很小或者沒有,因為GPU可以通過並行計算的方式來减少內存延遲。因此CPU的Cahce設計主要是實現低延遲,Control主要是通用性,複雜的邏輯控制單元可以保證CPU高效分發任務和指令。所以CPU擅長邏輯控制,是串行計算,而GPU擅長高强度計算,是並行計算。打個比方,GPU就像成千上萬的苦力,每個人幹的都是類似的苦力活,相互之間沒有依賴,都是獨立的,簡單的人多力量大;CPU就像包工頭,雖然也能幹苦力的活,但是人少,所以一般負責任務分配,人員調度等工作。
可以看出GPU加速是通過大量線程並行實現的,因此對於不能高度並行化的工作而言,GPU就沒什麼效果了。而CPU則是串行操作,需要很强的通用性,主要起到統管和分配任務的作用。
CUDA
CUDA是NVIDIA推出的用於自家GPU的並行計算框架,也就是說CUDA只能在NVIDIA的GPU上運行,而且只有當要解决的計算問題是可以大量並行計算的時候才能發揮CUDA的作用。
cuDNN
cuDNN(CUDA Deep Neural Network library):是NVIDIA打造的針對深度神經網絡的加速庫,是一個用於深層神經網絡的GPU加速庫。如果你要用GPU訓練模型,cuDNN不是必須的,但是一般會采用這個加速庫。
總結
簡單來說,CPU適合串行計算,擅長邏輯控制。GPU擅長並行高强度並行計算,適用於AI算法的訓練學習
CUDA 是NVIDIA專門負責管理分配運算單元的框架
cuDNN是用於深層神經網絡的gpu加速庫
查詢版本命令:
ubuntu:
cuda 版本
nvcc -V
cat /usr/local/cuda/version.txt
cudnn 版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
查看Nvidia GPU版本
nvidia-smi
//10s顯示一次
watch -n 10 nvidia-smi
nvidia-smi -l
版权声明
本文为[挽手等風起]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231116328538.html
边栏推荐
- 分享两个实用的shell脚本
- Get things technology network optimization - CDN resource request Optimization Practice
- MySQL interview questions explain how to set hash index
- Mysql系列SQL查询语句书写顺序及执行顺序详解
- remote: Support for password authentication was removed on August 13, 2021.
- Excel · VBA custom function to obtain multiple cell values
- MySQL面试题讲解之如何设置Hash索引
- Mysql database transaction example tutorial
- MBA-day5数学-应用题-工程问题
- Analysis on the characteristics of the official game economic model launched by platoffarm
猜你喜欢
Canvas详解
Visual Road (XII) detailed explanation of collection class
Visual common drawing (I) stacking diagram
Interprocess communication -- message queue
26. 删除有序数组中的重复项
使用 PHP PDO ODBC 示例的 Microsoft Access 数据库
Learn go language 0x04: Code of exercises sliced in go language journey
采用百度飞桨EasyDL完成指定目标识别
PDMS soft lithography process
Cygwin 中的 rename 用法
随机推荐
More reliable model art than deep learning
26. Delete duplicates in ordered array
学习 Go 语言 0x07:《Go 语言之旅》中 Stringer 练习题代码
@valid,@Validated 的学习笔记
学习 Go 语言 0x08:《Go 语言之旅》中 练习使用 error
After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
VM set up static virtual machine
Learning website materials
Visual common drawing (V) scatter diagram
Promise details
MySQL8.0升级的踩坑历险记
Use of SVN:
Usage Summary of datetime and timestamp in MySQL
MySQL partition table can be classified by month
Detailed explanation of integer data type tinyint in MySQL
Mba-day5 Mathematics - application problems - engineering problems
得物技术网络优化-CDN资源请求优化实践
妊娠箱和分娩箱的区别
学习 Go 语言 0x02:对切片 Slice 的理解
Mba-day5 Mathematics - application problems - engineering problems