当前位置:网站首页>GPU, CUDA,cuDNN三者的关系总结
GPU, CUDA,cuDNN三者的关系总结
2022-04-23 11:16: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://blog.csdn.net/qq_36697196/article/details/124329433
边栏推荐
- Data analysis learning (I) data analysis and numpy Foundation
- Excel·VBA数组冒泡排序函数
- 学习 Go 语言 0x03:理解变量之间的依赖以及初始化顺序
- 如何使用JDBC CallableStatement.wasNull()方法调用来查看最后一个OUT参数的值是否为 SQL NULL
- 活动进行时! 点击链接加入直播间参与“AI真的能节能吗?”的讨论吧!
- Typora operation skill description (I) md
- 学习 Go 语言 0x07:《Go 语言之旅》中 Stringer 练习题代码
- 讯飞2021年营收183亿:同比增41% 净利为15.56亿
- Visual common drawing (I) stacking diagram
- Constraintlayout layout
猜你喜欢
PDMS soft lithography process
Microsoft Access database using PHP PDO ODBC sample
Database management software sqlpro for SQLite for Mac 2022.30
Learn go language 0x04: Code of exercises sliced in go language journey
Promise details
Visual solutions to common problems (VIII) mathematical formulas
语雀文档编辑器将开源:始于但不止于Markdown
The songbird document editor will be open source: starting with but not limited to markdown
关于JUC三大常用辅助类
After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
随机推荐
Learning go language 0x02: understanding slice
MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
MySQL sorting feature details
Promise详解
Learning go language 0x01: start from the official website
MySQL failed to insert the datetime type field without single quotation marks
Mba-day5 Mathematics - application problems - engineering problems
PlatoFarm推出正式版游戏经济模型的特点分析
More reliable model art than deep learning
Constraintlayout layout
mysql中整数数据类型tinyint详解
FileProvider 路径配置策略的理解
Oracle connectivity test gadget
SVN的使用:
Interprocess communication -- message queue
Visual solutions to common problems (VIII) mathematical formulas
Typora operation skill description (I) md
学习 Go 语言 0x08:《Go 语言之旅》中 练习使用 error
Typora operation skill description (I)
年度最尴尬的社死瞬间,是Siri给的