提交 86fdfdaf authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5208 from notoraptor/PCIBusID

Pci bus ID now printed for GPU cards
......@@ -85,9 +85,18 @@ def init_dev(dev, name=None):
# This will map the context name to the real context object.
reg_context(name, context)
if config.print_active_device:
try:
pcibusid = context.pcibusid
except pygpu.gpuarray.UnsupportedException:
pcibusid = '(unsupported for device %s)' % dev
except Exception:
warnings.warn('Unable to get PCI Bus ID. Please consider updating libgpuarray and pygpu.')
pcibusid = 'unknown'
print("Mapped name %s to device %s: %s" %
(name, dev, context.devname),
file=sys.stderr)
print("PCI Bus ID:", pcibusid, file=sys.stderr)
pygpu_activated = True
ctx_props = _get_props(name)
ctx_props['dev'] = dev
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论