Bumblebee- GPU related commands freeze system when gpu is powered off via bbswitch


I own an Asus Rog Strix Scar III - model G531GV which runs a side by side installation of Parrot OS together with the already installed Windows 10 OS.

After a lot of struggle and numerous hard resets, I managed to configure Bumblebee up to the point that optirun/primusrun commands work as they should (Not for all commands, primusrun nvidia-smi/lspci -k lead to a system freeze), use machine’s GPU, and when the command completes bbswitch kicks in and completely powers off GPU, that way power management support is in place.

cat /proc/acpi/bbswitch -> 0000:01:00.0 OFF

While that’s what I wanted to accomplish in the first place I soon realized that while GPU is powered off by bbswitch, any GPU related commands like:

lspci -k

etc, completely freeze my computer. The cursor stops responding, no shortcut that could drop me into any kind of TTY sessions work, and in general nothing works besides powering off the machine through power button. Moreover, I can’t even check what is getting recorded in syslog or elsewhere regarding this error since nothing is there when I reboot the computer.

My system specifics are the following:

Laptop model                   : Asus Rog Strix Scar III - G531GV
Installed OS                   : Parrot 4.9 64-bit (full updated)
Kernel                         : Linux 5.5.0-1parrot1-amd64 x86_64
Nvidia Gpu                     : RTX-2060 6GB
Nvidia-Drivers                 : Latest - Proprietary 440.82
Bumblebeed Version             : 3.2.1

I would be more than happy to issue any requested commands to finally overcome this nightmare. I’ve gone through numerous posts and forums and tried many different things like grub parameters but nothing seems to make a difference. I’m really stuck at this point for more than ten days or so.

Moreover, i’d like to note that bumblebee is not the only implementation that i’d like to have for power management, nvidia-prime would be also useful for me as well but i’m not sure if there is a way to have this configured in debian. At least i can’t find any specific details on how i could install nvidia-prime package which seems to be missing from repos.

Any help would be really valuable,
Thank you all in advance.

Rather go for PRIME offload
and dynamic power management

I apologize for this late answer, was kind of a hard month and had almost zero time for anything.
Generix, thank you very much for your answer, it was exactly what i had to do to erase any kind of problems that i had with bumblebee/bbswitch. Now that nvidia prime gpu render offload is in place there is no system freezing at all when executing gpu related commands. Moreover, dynamic power management works flawless, my laptop remains cool most of the times and battery duration is increased by 1 hour or more when compared to using iGPU / dGPU at the same time. My only problem for now is that i wanna manage manually my gpu’s fans and i fail to do so but i’ll start a new thread for this hoping there will be another great answer so i cant eliminate that problem too!
Thanks a lot!