Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_gpu_info to get NVIDIA-related information like with nvidia-smi #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jsaied99
Copy link

@jsaied99 jsaied99 commented Jun 9, 2023

Adding pg_gpu_info to get NVIDIA-related information like with nvidia-smi

@jsaied99 jsaied99 changed the title Nvidia info pg_gpu_info to get NVIDIA-related information like with nvidia-smi Jun 9, 2023
@levkk
Copy link
Contributor

levkk commented Jun 9, 2023

Good start! Do you think it could be possible to make those metrics part of the pg_stat_sysinfo view?

Also curious, how fast is it to query this as compared to our sysinfo crate we use for everything else? We use this extension for collecting metrics in our production cloud every second, so ideally it would be very quick to fetch any metric that we're reporting. If NVIDIA metrics are slower to collect, it would make sense to store them in a different function we can call less frequently, like this PR implements.


```sql
----
SELECT device_id, device_name, total_memory_mb, used_memory_mb, temperature_c from pg_gpu_info();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to namespace this function to this extension as well, if we are to use this approach. Like we do with PostgresML, it should be something like SELECT * FROM pg_stat_sysinfo.gpu_metrics() or similar.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @levkk! I will look at the performance of getting the gpu_metrics vs. the others. Namespacing the function is also a good idea.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also update the pgrx dependencies. I didn't right off the bat because I was getting some errors, but we definitely should.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, good call. Would be great to match the pgrx version here with what we have in postgresml/postgresml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants