这样就可以显示机器上的显卡信息,比如
[root@localhost conf]# lspci | grep -i vga
01:00.0 VGA compatible controller: nVidia Corporation Device 1081 (rev a1)
02:00.0 VGA compatible controller: nVidia Corporation GT215 [GeForce GT 240] (rev a2)
08:05.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 10)
如果想看详细的信息,比如 GeForce GT 240,即 02:00.0
[root@localhost conf]# lspci -v -s 02:00.0
02:00.0 VGA compatible controller: nVidia Corporation GT215 [GeForce GT 240] (rev a2) (prog-if 00 [VGA controller])
Subsystem: ASUSTeK Computer Inc. Device 8351
Flags: bus master, fast devsel, latency 0, IRQ 169
Memory at f9000000 (32-bit, non-prefetchable) [size=16M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
Memory at ce000000 (64-bit, prefetchable) [size=32M]
I/O ports at bc00 [size=128]
[virtual] Expansion ROM at f8f80000 [disabled] [size=512K]
……………………………
可以看到GT240的显存是 256M
先在CPU中生成了随机数。linux跑pytorch因为先在CPU中生成了随机数。在使用pytorch的过程中,发现CPU占用率过高。经过检查,发现是因为先在CPU中生成了随机数,然后再调用to(device)传到GPU。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)