Open JustUsers opened 4 years ago
I have corrected your problem above only to come to another issue. This issue only exists if you run the program using 32 bit python. It looks like you might be using 32 bit python 2.7. Try using python 2.7 x64 and see if it works. I know that it does run on Python 3.7 x64 and I have tested this.
This library is still under development mind you and not all things have been tested. I have not tested changing any of the settings. I do not know what the ADL has built into it in terms of protection against making an incorrect setting change. I have not tested this portion of the library just yet because I have a fear of possibly breaking something in my computer. Until I build a crap PC out of parts I have kicking around and an older (cheap) video card I do not care so much about I strongly suggest against changing any of the settings.So heed my warning there, and understand that I am not responsible if some kind of a problem occurs. I do not believe that AMD would allow for this to happen I am not able to tell you if that is the case with 100% certainty. I do not think you can cause any issues with changing the brightness or contrast of a display or changing the fan speed. But I do however think that changing the clock speed of the memory or the core could if AMD did not build in any kind of protection.
The example only enumerates the current settings.
I believe the connector indexes are a way to identify the displays as seen in the Windows Screen Resolution control panel. how you may the connector index to the display number that is show in the control panel is add 1 to it.
Here is an example of how to change the brightness on display 1. I do not know if it works or not I haven't tested it.
from __future__ import print_function
import pyamd_adl
for adapter in pyamd_adl.adapters:
for connector in adapter:
if connector.index + 1 != 1:
continue
display = connector.display
if display is None:
raise RuntimeError('No display is connected to connector index ', connector.index + 1)
supported = display.is_brightness_supported
print('supports brightness adjustment:', supported)
if supported:
brightness = display.brightness
current_brightness = brightness.real
import time
while brightness < brightness.max:
brightness += brightness.step
time.sleep(0.02)
while brightness > brightness.min:
brightness -= brightness.step
time.sleep(0.02)
while brightness < current_brightness:
brightness += brightness.step
time.sleep(0.02)
thank you very much! example.py is ready to run, but it seems that there are still some problems, such as:
Traceback (most recent call last):
File "D:\test\993-ati_radeon-master\example.py", line 58, in <module>
print('bus_speed:', adapter.bus_speed)
File "D:\test\993-ati_radeon-master\pyamd_adl\adapter_h.py", line 2608, in bus_speed
return overdrive.bus_speed
File "D:\test\993-ati_radeon-master\pyamd_adl\overdriven_h.py", line 473, in bus_speed
return self._performance_stats.iCurrentBusSpeed.value
AttributeError:'int' object has no attribute'value'
-------------------------------------------------- -
Traceback (most recent call last):
File "D:\test\993-ati_radeon-master\example.py", line 65, in <module>
print(' min:', power_control.min)
AttributeError:'NoneType' object has no attribute'min'
-------------------------------------------------- -
Traceback (most recent call last):
File "D:\test\993-ati_radeon-master\example.py", line 72, in <module>
for temperature in temperatures:
TypeError:'NoneType' object is not iterable
and many more
I look forward to optimization of this, thank you
There are so many different "flavors" of the ATI video card and not all of them support all of the variations and combinations of setings. I only have a single card I am testing with at the moment. So until I get more feedback like what you are providing me I am not going to be able to tweak the library to get it working 100% correctly.
what version of Python are you using?
I also wanted to mention That my video card uses overdrive 5, it would seem that your card uses overdrive N. I changed the modeling of how I am handling the overdrive settings. I did this with the overdrive 5 class and I have not done it with the other overdrive classes. I will work on getting overdrive N modeled in the same fashion. It is probably going to take me a day to do. I have also not been able to work through any bugs in any of the other overdrive classes. You will have to work through the issue with me. In order to do that any errors or tracebacks you get you will need to post the entire traceback for me this way I can follow the trail to isolate where the issue is.
windows10 x64 + python 2.7.10(64-bit)
and I tried to modify "example2.py" like this (To find out more traceback at once) :
The following is the running result:
Do me a favor. can you edit your last response and add this before the code block
<details>
<summary>example.py (click to show)</summary>
and this after the code block
</details>
make sure you leave a blank line before the triple ticks at the top of the code block and also a blank line after the triple ticks at the end of the code block.
You will end up with the following.
you are getting a bunch of tracebacks because of the overdrive version you are using. I am in the process of fixing that now. It is a pretty involved process for me to fix it because of the amount of work I need to do. There are 4 versions of overdrive and they all operate differently so I have to come up with a common API that all 4 versions can share. this way anyone using it is not going to have to know what version of overdrive they are using they are only going to need to know how to set the clock speed or how to set the memory voltage. the ADL is a nested rats maze and I am trying to turn it into something that is easy to use and understand how to use. The amount of code needed just to be able to provide the ability to get the information that the example.py file provides is massive, ay some 28000 lines of code. Naavigating that mount of code and changing things takes time to do. I do not want to cause problems elsewhere so it has to be done carefully and with quite a bit of planning beforhand.
I do not want the user to have to put all of the try/except statements in their code. those statements are expensive to run and can be handled in the library it's self so the user will not have to deal with that kind of thing.
OK I just finished updating the code. Go ahead and run the original example.py file. I know there are going to be errors so please paste the entire output to me. Do not change the example.py file at all I am looking for a specific behavior so it has to remain the same for the time being.
This is the result of the current run
Thanks for doing the expandable menu thing. You only need to do that with super long blocks of text. It makes it easier to scroll to the bottom of the posts. and it also minimizes GitHubs condensing of the posts.
I just did a push to the repo. so give it a go and see what you get this time. these are not working where they were not before. so that means I am on the right track!
bus_speed: 50 bus_lanes: 1 max_bus_lanes: 16
make sure you use the example.py file included in my repo. I had to update it.
new result
and this is a screenshot of GPUZ at the same time:
OK so comparing what this library does to GPUz may not give you the exact same information. reason being is that GPUz could be using Windows in order to collect some of it's information. The gpu temperature is different. This could be because of the reason i mention earlier or it could also be stale information in GPUz. I do not know how often it polls to collect the information.
I did a push to the repository again so we should be back up and running.
The fan speeds are listing correctly I have to come up with some kind of a better way to relay what is exactly going on. with overdrive n you have the ability to have the driver control the speed of the fan based on several things.
there are a couple of different types of controls.
you also have the ability to set whether the control of that type is automatic or manual. on your card it looks like the only control that is available is the acoustic control. this control is where you set the core clock at which you want the fan to be at max and it will handle it from there. The slider bar you are seeing in GPUz has a percentage. this is really misleading when you move that slider up towards 100% the fan gets faster and faster This would be the same thing as lowering the max core frequency in the fan control in this library and it is easy to get the percentage because you know the min and max and value.
new result
getting further.
I just updated the code it should hopefully fix that issue.
It appears as tho there is an issue with the memory and core clocks and voltages. I will have to add some error logging code to see what is happening.
new result
Please note that there are 2 graphics cards
OYE! Now I have another issue to fix. I am brain dead. I wasn't thinking when I set up the overdrive classes. I don't know why but the whole multiple adapter things didn't dawn on me.
Anywho I did update the code to log the returned values from the adl functions in the event that the call to the function is a failure. In some cases this is OK that it fails. the memory and core clocks and voltages are not population so a failure is happening and I need to know what the error message is.
I changed the example.py file so it turns on the debugging messages by default. You can turn it off by commenting out the line at the top of the example where it gets set.
I need to see the results with it turned on if you wouldn't mind. I will get the overdrive classes sorted out. I am going to have to put into place an instance singleton metaclass . you will need to have the six package installed into python for it to work. This is not going to be for the version that is currently available my next update is going to make this a requirement.
new result :-)
new result "NameError: global name '_ADL2_Overdrive8_Init_SettingX2_Get' is not defined"
And last year, I searched for a similar function and found this https://github.com/nicolargo/pyadl. Although it has not been updated for 3 years, And the function is limited, but it still works properly on "Radeon RX 580 Series", there should still be references, I hope it can help you. Your project looks very comprehensive, let us improve it together.
I can't express myself very well in English, hope i didn't offend you.
you're English is fine, in fact you type it better then I do .. LOL
I did come across that library and it has extremely limited functionality. All of the parts I am working through bugs with are not in that library. Plus that library is only for display purposes. It does not allow you to change any of the cards settings. I have been fighting with the developers over at AMD and complaining about their laziness and not documenting and not documenting properly. And also them not responding to questions. It's extremely annoying to have to do what we are doing right now because they see fir not to answer questions and also have shit poor documentation.
So I apologize for having you go through this. I do promise I will get the issues sorted out don't you worry there. It's going to be some trial and error tho and it may take a while because of the time difference
C:\Python27\python.exe D:/py/996-ati_radeon-master/example.py Traceback (most recent call last): File "D:/py/996-ati_radeon-master/example.py", line 27, in
import pyamd_adl
File "D:\py\996-ati_radeon-master\pyamd_adl__init__.py", line 62, in
from .adl_sdk_h import Adapters as _Adapters
File "D:\py\996-ati_radeon-master\pyamd_adl\adl_sdk_h.py", line 27, in
from .adl_structures_h import # NOQA
File "D:\py\996-ati_radeon-master\pyamd_adl\adl_structures_h.py", line 26, in
from .adl_defines_h import # NOQA
File "D:\py\996-ati_radeon-master\pyamd_adl\adl_defines_h.py", line 555, in
ADL_STEREO_AUTO_VERTICAL = Constant(1 << 31).set_string('Stereo Auto Vertical')
OverflowError: Python int too large to convert to C long