Have you run HP Diagnostics to see if it finds the GPU defective?
Do you have a AMD or Intel APU Processor?
If AMD you must install the AMD APU Driver which will install both the Integrated and GPU card in your laptop. I would use HP AMD Driver since it is 100% compatible.
Did you upgrade the original Windows OS to Windows 10?
From HP Support concerning HP Pavilion Notebook - 17-g050nl Manuals & Documentations: https://support.hp.com/us-en/product/hp-pavilion-17-g000-notebook-pc-series/7771368/model/8636984/ma...
Looking at one of the Service Manuals it seems like the GPU is built into the Motherboard (Soldered) . So most likely you will need to replace the motherboard if the Discrete GPU is defective.
HP Support Laptop Drivers: https://support.hp.com/us-en/drivers/selfservice/hp-pavilion-17-g000-notebook-pc-series/7771368/mode...
Make sure you have the latest BIOS version installed and then using DDU with the internet disconnected and deleting AMD Installation folder at C:\AMD download and install the HP AMD Driver for your laptop and see if your GPU card now starts working or not.
Make sure Windows is fully updated via Windows Update.
Run HP Diagnostics software from your laptop and from HP Online Diagnostics from here: https://support.hp.com/us-en/help/diagnostics?category=computing
Your Laptop's APU Processor is considered to be legacy with no more AMD Support nor Driver updates. So depending on which AMD APU processor you have installed will determine how old your AMD driver will be for both the Integrated and Discrete GPUs.
EDIT: How do you know your GPU Card is defective?