Please provide the following info (tick the boxes after creating this topic): Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other
Target Operating System
Linux
QNX
other
Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other
SDK Manager Version
1.9.3.10904
other
Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other
I’ve seen a number of times now where the reboot workaround mentioned in the DRIVE OS 6.0.4 release notes does not reliably work for us. The first time the command just returns nothing, and subsequent runs show a permission denied issue. Could someone provide some info or debugging steps to determine the issue?
Dear @ibiala1,
I could reboot using below commands. Could you check running the command directly instead of keeping them script to confirm if it works for you.
$ sudo su
$ echo 1 > /sys/class/tegra_hv_pm_ctl/tegra_hv_pm_ctl/device/trigger_sys_reboot
Hi, I wanted to provide some more information and hopefully someone at nvidia can explain what’s happening.
rebootme is a script that just does the echo 1 > /sys/class/tegra_hv_pm_ctl/tegra_hv_pm_ctl/device/trigger_sys_reboot. It also works most of the time, but as in the original post sometimes we are receiving EPERM from what looks like the underlying hypervisor.
We did a set of testing with common_if_testapp -mcureset (thank you for the suggestion!), and we noticed roughly 50% of the time that connected usb devices were not scanned when Linux was restarted using this technique, which made them invisible to the operating system until they were power cycled. It also added roughly 15 seconds to the reboot over the trigger_sys_reboot approach.
We tracked the EPERM error to
__attribute__((no_sanitize_address)) static inline int hyp_guest_reset(unsigned int id,
struct hyp_sys_state_info *out)
which is called from:
int tegra_hv_pm_ctl_trigger_sys_reboot(void)
It appears from my read of this kernel source code that EPERM is being returned by the hypervisor, which I believe I don’t have the source code for, so I don’t know what could be causing it.
Is there any additional logging we could get from the hypervisor that would tell us why it decided to return an EPERM?
From dmesg this is the actual logging message: tegra_hv_pm_ctl_trigger_sys_reboot: Failed to trigger system reboot, -13
sudo su
$ echo 1 > /sys/class/tegra_hv_pm_ctl/tegra_hv_pm_ctl/device/trigger_sys_reboot
works as expected, sometimes we get that EPERM error. If I was an nvidia employee, I would look through the hypervisor code to see where it returns EPERM for an idea of where to start.
We also see this in the dmesg as well (hopefully this helps you track down the issue): Jan 08 17:06:49 tegra-ubuntu kernel: tegra_hv_pm_ctl_get_guest_state: Failed to get guest0 state, -38
Dear @cstaylor,
We notice repeated use of trigger_sys_reboot causes permission denied. This is a known issue and notified the team for fix. I hope this issue is not blocker to you.
– When you say ‘repeated use’, does that refer to multiple times in a row, i.e., if it fails to reboot on first command re-issuing the command, or do you mean using it regularly to cause reboots to occur?
– Given that we now have several devices that are in this state, is there a reliable way to reset them such that this command works as expected?
– Does NVIDIA have a recommended way to issue a reboot command that reliably works in all circumstances? We note that conapp mcureset does not bring up the USB stack properly after reboot, and the builtin Linux reboot causes kernel panics. This command was provided as an NVIDIA-sanctioned method of rebooting, and now we are being told it is not proper to use in everyday situations.
Hi! So we did some more debugging today and we found that the systems that fail to reboot all have the nv_virtual_shutdown systemd service masked.
If we unmask this service, reboot via the trigger_sys_reboot works as expected.
We also tracked a possible reason for the masking to the /etc/systemd/scripts/nv_virtual_shutdown.sh script, where if it can’t find the character device /dev/tegra_hv_pm_ctl, it will automatically mask the service.
Hopefully that helps nvidia in their debugging of this problem. If this is where the masking is happening, I suggest checking if the kernel module is loaded that provides this character device before making the drastic decision to permanently fail reboots.
@cstaylor
Thank you for providing additional insights into the issue. Your debugging efforts are greatly appreciated.
It appears that the nv_virtual_shutdown systemd service being masked is causing the failure in reboot via the trigger_sys_reboot command. Based on your findings regarding the /etc/systemd/scripts/nv_virtual_shutdown.sh script, we presume that the service is being masked when the character device /dev/tegra_hv_pm_ctl is not found.
This patch introduces a dependency on the existence of /dev/tegra_hv_pm_ctl for the nv_virtual_shutdown service and simplifies the script by removing HV conditions and the service mask.
Please apply this patch and let us know if it resolves the issue. Your feedback on the effectiveness of this solution will be valuable for further investigation.