mathoudebine / turing-smart-screen-python

Unofficial Python system monitor and library for small IPS USB-C displays like Turing Smart Screen or XuanFang
GNU General Public License v3.0
1.17k stars 196 forks source link

Cannot select GPU to use when there's an APU/iGPU available #537

Closed Virkkunen closed 2 months ago

Virkkunen commented 4 months ago

Describe the bug
I have an AMD 7800X3D and a NVIDIA RTX 3080. Previously I had an AMD 5900X, which does not have an iGPU, so the script correctly identified and used my 3080. Now that I've changed the CPU and the 7800X3D has an iGPU, it's always detected and prioritised over my NVIDIA card.

Environment:

Additional context
The logs only show this:

5 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] HW sub-revision: SubRevision.USBMONITOR_3_5
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Image: BACKGROUND
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Bitmap res/themes/Catpunk/background.png is now loaded in the cache
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Text: CPU_MODEL
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Text: GPU_MODEL
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Text: RAM_MODEL
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Text: DOWNLOAD_RATE
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Text: UPLOAD_RATE
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [DEBUG] Drawing Text: DISK_USAGE
Jul 15 20:59:46 endeavour python[34570]: 15/07/24 20:59:46 [INFO] Detected AMD GPU(s)
Virkkunen commented 4 months ago

On context, this works fine on my Windows installation, it correctly shows the NVIDIA card. The logs:

16/07/2024 13:17:10 [DEBUG] HW revision: A
16/07/2024 13:17:10 [DEBUG] Auto detected COM port: COM6
16/07/2024 13:17:10 [DEBUG] Found LibreHardwareMonitorLib 0.9.3.0
16/07/2024 13:17:12 [INFO] Found CPU: AMD Ryzen 7 7800X3D
16/07/2024 13:17:12 [INFO] Found Memory: Generic Memory
16/07/2024 13:17:12 [INFO] Found AMD GPU: AMD Radeon(TM) Graphics
16/07/2024 13:17:12 [INFO] Found Nvidia GPU: NVIDIA GeForce RTX 3080
16/07/2024 13:17:12 [INFO] Found Storage: CT1000MX500SSD1
16/07/2024 13:17:12 [INFO] Found Storage: WDS100T3X0C-00SJG0
16/07/2024 13:17:12 [INFO] Found Storage: WD_BLACK SN850X HS 1000GB
16/07/2024 13:17:12 [INFO] Found Network interface: Bluetooth Network Connection 5
16/07/2024 13:17:12 [INFO] Found Network interface: Ethernet
16/07/2024 13:17:12 [INFO] Found Network interface: Local Area Connection* 10
16/07/2024 13:17:12 [INFO] Found Network interface: Local Area Connection* 11
16/07/2024 13:17:12 [INFO] Found Network interface: WiFi
16/07/2024 13:17:12 [DEBUG] Using Python 3.11.3 (tags/v3.11.3:f3909b8, Apr  4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)]
16/07/2024 13:17:12 [INFO] Tray icon has been displayed
16/07/2024 13:17:12 [INFO] Display reset (COM port may change)...
16/07/2024 13:17:17 [DEBUG] Static COM port: COM6
16/07/2024 13:17:17 [DEBUG] HW sub-revision: SubRevision.USBMONITOR_3_5
16/07/2024 13:17:17 [DEBUG] Drawing Image: BACKGROUND
16/07/2024 13:17:17 [DEBUG] Bitmap res/themes/Catpunk/background.png is now loaded in the cache
16/07/2024 13:17:17 [DEBUG] Drawing Text: CPU_MODEL
16/07/2024 13:17:17 [DEBUG] Drawing Text: GPU_MODEL
16/07/2024 13:17:17 [DEBUG] Drawing Text: RAM_MODEL
16/07/2024 13:17:17 [DEBUG] Drawing Text: DOWNLOAD_RATE
16/07/2024 13:17:17 [DEBUG] Drawing Text: UPLOAD_RATE
16/07/2024 13:17:17 [DEBUG] Drawing Text: DISK_USAGE
16/07/2024 13:17:17 [WARNING] Found 2 GPUs on your system (1 AMD / 1 Nvidia / 0 Intel). Auto identify which GPU to use.
16/07/2024 13:17:17 [DEBUG] This GPU will be used for stats: NVIDIA GeForce RTX 3080
Virkkunen commented 3 months ago

I didn't see this mentioned anywhere but branch https://github.com/mathoudebine/turing-smart-screen-python/tree/fix/537-cannot-select-gpu-to-use-when-theres-an-apuigpu-available fixes this issue. Apparently it was a very easy solution to just change the priorisation under the is_Available function

mathoudebine commented 2 months ago

Hello @Virkkunen indeed I made a branch with the fix but didn't have the time to merge it. It is now done, thank you for your feedback!