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

Added GPU Temperature and utilization #3

Merged
merged 10 commits into from
Jul 25, 2023
Merged

Conversation

JeremiahPetersen
Copy link
Contributor

This pull request introduces the following changes:

  1. AMD Support: Implemented a check for the availability of the pyadl library and the accessibility of AMD drivers. This ensures that the application only attempts to retrieve AMD GPU details if they are accessible.
  2. Temperature Information: A new section, "Temperature," has been added to the GUI to display the temperature details of the CPU and GPUs (both NVIDIA and AMD). It uses psutil, GPUtil, pyadl, and wmi to fetch the temperature details based on the system and platform.
  3. Error Handling in Graphics Section: Enhanced the error handling in the graphics section to display a message if there's an issue fetching the AMD GPU details.

Please review and let me know of any feedback or changes required.

@JeremiahPetersen JeremiahPetersen changed the title added CPU and GPU temperatures Added CPU and GPU Temperatures Jul 24, 2023
@diamant3
Copy link
Owner

Thank you so much for your PR!

By the way, I based the SYSIG app into a major parts of a computer, please don't separate the section for minor section like temperature, I suggest to add that temp info to processor section and Graphics section and please minimize the use of modules as possible and lastly, run pip install -r requirements.txt first for every OS.

Sorry for my long and demanding request because I don't have any build workflow(just a linter 😢) for every possible OS to test.

@JeremiahPetersen
Copy link
Contributor Author

no worries at all, thank you for the feedback! I will work on these adjustments in the next 24 hours :)

@diamant3
Copy link
Owner

Okay I will review that asap, thanks again!

@JeremiahPetersen
Copy link
Contributor Author

JeremiahPetersen commented Jul 24, 2023

I added GPU temp (updates every second) as a bullet in Graphics
I added CPU temp (updates every second) as a bullet in Processor
GPU temp is working on all tests so far
CPU temp is not updating every second as expected on windows platforms. (mechanism is working, so I am working to find another solution to this today.)

@JeremiahPetersen JeremiahPetersen changed the title Added CPU and GPU Temperatures Added CPU and GPU Temps, and GPU utilization Jul 24, 2023
@JeremiahPetersen JeremiahPetersen changed the title Added CPU and GPU Temps, and GPU utilization Added CPU & GPU Temps, added GPU utilization Jul 24, 2023
@diamant3
Copy link
Owner

Ok, let me know if it's ready for review. Thanks!

@JeremiahPetersen
Copy link
Contributor Author

It is ready for review now. The gpu temp and utilization are working. The cpu temp is working, but for some windows / intel systems, it would need additional software (Open Hardware Monitor OHM) which would be adding too much and may be unnecessary. I cleaned up the code. Let me know what changes you would like.

Copy link
Owner

@diamant3 diamant3 left a comment

Choose a reason for hiding this comment

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

I've reviewed it all now. I will run the workflow and merge it later if it's running correctly.

requirements.txt Outdated Show resolved Hide resolved
sysig.py Outdated
amd_manager = pyadl.ADLManager.getInstance()
devices = amd_manager.getDevices()
for device in devices:
temperature_data = device.getTemperature()
Copy link
Owner

Choose a reason for hiding this comment

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

I think it's getCurrentTemperature(), please check their docs if correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked here - https://github.com/nicolargo/pyadl - and you are correct. I made the changes.

Copy link
Owner

Choose a reason for hiding this comment

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

Okay, thanks!

sysig.py Outdated
temperature_info = w.MSAcpi_ThermalZoneTemperature()[0]
return temperature_info.CurrentTemperature / 10.0 - 273.15
except wmi.x_access_denied:
return "Access Denied (Run script as administrator)"
Copy link
Owner

Choose a reason for hiding this comment

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

Is there any solution for this without using administrator access in Windows? All of the modules I used don't need administrator access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was the problem I was running into, I researched the problem for a while and the solutions were to run wmi using admin access, or use additional software like OHM. As the graphics additions are working, I can scrap the cpu temp idea until I can figure out a better solution for Windows / Intel. I can remove the cpu temperature code for now if you would like to incorporate just the gpu additions.

Copy link
Owner

Choose a reason for hiding this comment

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

use additional software like OHM.

Please don't, This is just a simple app 😅

I can remove the cpu temperature code for now if you would like to incorporate just the gpu additions.

If it's okay with you, Please do. It's better to do GPU additions for now, and you can submit another PR if you have a solution for admin access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol yea I like that it is a simple app. I was trying to implement an easy way to see cpu temp but it turned out to be a rabbit hole lol. I like keeping it simple. That sounds good. I will edit the code and send that in a moment

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks! I will run the workflow and merge this later.

@JeremiahPetersen JeremiahPetersen changed the title Added CPU & GPU Temps, added GPU utilization Added GPU Temperature and utilization Jul 25, 2023
@JeremiahPetersen
Copy link
Contributor Author

This is good for review, I removed the cpu temp and will continue researching to see if it is possible to do in a simple way. If not, no worries. The gpu additions should all be working without issue now. Let me know if there are any other changes to make. Thanks for letting me contribute and providing clear direct feedback!

@diamant3
Copy link
Owner

Don't worry it's just errors for variable naming, length of line etc., I'll merge this later. thanks again!

@JeremiahPetersen
Copy link
Contributor Author

no worries! I was going through each of the errors and realizing that lol

@diamant3 diamant3 merged commit 369d3a0 into diamant3:main Jul 25, 2023
@diamant3
Copy link
Owner

Thanks!

@JeremiahPetersen
Copy link
Contributor Author

You are welcome! Thank you!

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