kobalicek / amdtweak

A library that can be used to manipulate ATOM and PowerPlay (PP) tables of AMDGPUs
71 stars 20 forks source link

Can't write to file #5

Closed tomasbrod closed 6 years ago

tomasbrod commented 6 years ago

write_file_pp command seems broken. Says to accept 1 argument, but checks for 0. And it seems to try to write the table back to live driver, instead of user's file. Saving to file is important for backup-restore purposes and also to verify the program operation before committing a change to live card.

kobalicek commented 6 years ago

Sorry for inconvenience, I just looked at it and it seems I just copied it from __write_card_pp and forgot to implement it. Will fix it soon.

tomasbrod commented 6 years ago

You do not have to hurry. I just found that plain reading the pp_table and writing the same data back will crash the driver (rx560), so I won't be able to use this tool anyway.

kobalicek commented 6 years ago

You can email me your pp_table and I can check it out locally (and add it to tests). I remember fixing a similar bug where the library corrupted the table as well.

tomasbrod commented 6 years ago

I used dd/cat for that exercise.

cat /sys/class/drm/card0/device/pp_table >pp_table
cat pp_table >/sys/class/drm/card0/device/pp_table

Which crashed the driver (null pointer, but somehow no panic).

Your tool behaves correctly after patching the function with a hard-coded path.

tomasbrod commented 6 years ago

You should patch the function and upload the commit.

Lucie2A commented 6 years ago

This bug has been fixed with commit 2a4ff77e092af9fc1f8895b09616460f0f0ea220 and with pull request https://github.com/kobalicek/amdtweak/pull/10. This bug should be closed now.