Skip to content

Fix several issues in tegra observer - #408

Merged
benvanwerkhoven merged 4 commits into
masterfrom
fix-tegra-warning
Sep 29, 2026
Merged

benvanwerkhoven merged 4 commits into
masterfrom
fix-tegra-warning

Conversation

@loostrum

Copy link
Copy Markdown
Member

I ran into the following exception on a Jetson:

Tuning ...
Exception ignored while calling deallocator <function tegra.__del__ at 0xffff9ad38670>:
Traceback (most recent call last):
  File "/home/powersensor/kt_demo/kernel_tuner/kernel_tuner/observers/tegra.py", line 171, in __del__
    if self.has_changed_clocks:
AttributeError: 'tegra' object has no attribute 'has_changed_clocks'
Traceback (most recent call last):
...

The actual error is that I didn't specify the required input arguments to the Tegraclass. Apparently such a failure in __init__ means that any attributes defined in __init__ do not exist, but __del__ is still called at cleanup resulting in the exception. This PR fixes this by first checking whether the attribute exists before checking its value.

@loostrum
loostrum marked this pull request as draft September 29, 2026 09:04
@loostrum

Copy link
Copy Markdown
Member Author

Putting this back to draft because I actually found a few more issues in the Tegra observer, I will have a look at those at well.

@sonarqubecloud

Copy link
Copy Markdown

@loostrum

loostrum commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Other issues fixed:

  • get_tegra_gr_clocks failed because it initialized the Tegra class without the required arguments
  • The GPU temperature sensor name apparently varies between Jetson variants; I've added the name I see on my Jetson Orin Nano
  • The raw frequency to int conversion failed for the length-1 case

With these fixes, the tegra observer is working as expected again.

@loostrum
loostrum marked this pull request as ready for review September 29, 2026 09:23
@loostrum loostrum changed the title Fix exception in tegra __del__, occuring when __init__ fails Fix several issues in tegra observer Sep 29, 2026
@benvanwerkhoven

Copy link
Copy Markdown
Collaborator

Thanks @loostrum !

@benvanwerkhoven
benvanwerkhoven merged commit a467bdc into master Sep 29, 2026
4 checks passed
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