-
-
Notifications
You must be signed in to change notification settings - Fork 604
GPU: fix hiding unknown GPUs #1742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates the GPU module to change the behavior of the hide-type option so that unknown GPUs are hidden by default. Key changes include:
- Adding a new enum value (FF_GPU_TYPE_NONE) to represent the "none" option.
- Updating option parsing from command line and JSON to correctly map string values to the corresponding enum.
- Adjusting JSON configuration generation to output the revised enum mapping.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/modules/gpu/option.h | Added new enum value FF_GPU_TYPE_NONE to support "none". |
| src/modules/gpu/gpu.c | Updated option parsing and JSON configuration to use new enum mappings. |
Files not reviewed (2)
- doc/json_schema.json: Language not supported
- src/data/help.json: Language not supported
|
Please don't change the default behavior. The GPU type being set to unknown usually means the type detection is not supported on that platform. Your change will effectively hides all GPUs on those platforms. |
The current default behavior of not hiding any GPUs is retained. The new feature of hiding unknown or unrecognized GPUs can be enabled with hide-type = "unknown".
c6e9a0f to
c3bd301
Compare
|
The default will now remain as it was, ensuring that no GPUs are hidden by default. The new feature to hide unknown/unrecognized GPUs can still be enabled with hide-type = "unknown" for those who need it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the behavior of the GPU hide filter so that unknown GPUs are hidden when the "unknown" option is selected, while the old behavior (not hiding any GPUs) is restored using "none".
- Updates enum definitions in option.h to distinguish between "none" and "unknown".
- Adjusts command-line and JSON option parsing in gpu.c to correctly map the new enum values.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/modules/gpu/option.h | Modified enum values to set distinct roles for "none" and "unknown". |
| src/modules/gpu/gpu.c | Updated option parsing and JSON config generation to reflect the new enum mappings. |
Files not reviewed (2)
- doc/json_schema.json: Language not supported
- src/data/help.json: Language not supported
| typedef enum __attribute__((__packed__)) FFGPUType | ||
| { | ||
| FF_GPU_TYPE_UNKNOWN, | ||
| FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Useful as a hide filter only. |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider clarifying this comment to state that selecting FF_GPU_TYPE_NONE restores the old behavior (i.e., not hiding any GPUs) to avoid potential confusion with the new 'unknown' behavior.
| FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Useful as a hide filter only. | |
| FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Restores the old behavior of not hiding any GPUs. Useful as a hide filter only. |
The hide-type option now actually hides any unknown GPUs by default (hide-type == "unknown"). The old behavior (not hiding any GPUs) can be restored with "none".
Probably something of an edge-case, fastfetch would not hide a secondary GPU that is "recognized" as type == unknown (integrated in reality, but the kernel module is blacklisted because it messes things up otherwise).