简体   繁体   English

如何使用 C# 在 Ubuntu 上获取 GPU 信息?

[英]How do I get GPU info on Ubuntu using C#?

I would like to know how I can get the GPU info using a C# library on an Ubuntu 18.04 system?我想知道如何在 Ubuntu 18.04 系统上使用 C# 库获取 GPU 信息? I am interested in parameters like number of GPUs, GPU utilization, GPU memory etc.我对 GPU 数量、GPU 利用率、GPU 内存等参数感兴趣。

You might want to try OpenGL - it has cross-platform functions for getting information about the GPU such as vendor, version numbers, etc. so I would expect it also has support for getting the information you require.您可能想尝试 OpenGL - 它具有用于获取有关 GPU 的信息(例如供应商、版本号等)的跨平台功能,因此我希望它也支持获取您需要的信息。

It might not drill down enough to get GPU utilization/breakdown, memory etc. however - if you can't get it working through OpenGL/C# you can actually run commands from C# as if you had a terminal window open.它可能不足以深入了解 GPU 利用率/故障、内存等。但是 - 如果您无法通过 OpenGL/C# 使其工作,您实际上可以从 C# 运行命令,就像打开了一个终端窗口一样。

This explains how to set up C# to run commands on the system. 解释了如何设置 C# 以在系统上运行命令。

This and this explain what commands you might want to use to get the information about GPU that you need.解释了您可能想要使用哪些命令来获取有关您需要的 GPU 的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM