-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix(base): Device selection patch for gpu-screen-recorder (#93)
## Description Adds new `-device` argument for gpu-screen-recorder which allows specifying a GPU to use (by `/dev/dri/cardN` path) This fixes an issue with multi-gpu systems when device such as `/dev/dri/card1` is passed through but gpu-screen-recorder will still try to access `/dev/dri/card0` for capturing and failing. Added relevant bits to `gpu_helpers.sh` to find the card path - I assume all modern modesetting drivers will have a `/drm/` path that tells the card number. If not, the script will fall back to gpu-screen-recorder's own method of finding the card. Edit: Forgot to mention patches are now copied to /tmp/ rather than /etc/ Co-authored-by: Kristian Ollikainen <[email protected]>
- Loading branch information
1 parent
cf69f6c
commit 3df53e7
Showing
4 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/src/main.cpp b/src/main.cpp | ||
index 112a6ac..57bd9bf 100644 | ||
--- a/src/main.cpp | ||
+++ b/src/main.cpp | ||
@@ -1906,6 +1906,7 @@ int main(int argc, char **argv) { | ||
{ "-gopm", Arg { {}, true, false } }, // deprecated, used keyint instead | ||
{ "-keyint", Arg { {}, true, false } }, | ||
{ "-encoder", Arg { {}, true, false } }, | ||
+ { "-device", Arg { {}, true, false } }, | ||
}; | ||
|
||
for(int i = 1; i < argc; i += 2) { | ||
@@ -2226,6 +2227,10 @@ int main(int argc, char **argv) { | ||
overclock = false; | ||
} | ||
|
||
+ const char *dri_device = args["-device"].value(); | ||
+ if (dri_device) | ||
+ egl.dri_card_path = dri_device; | ||
+ | ||
egl.card_path[0] = '\0'; | ||
if(wayland || egl.gpu_info.vendor != GSR_GPU_VENDOR_NVIDIA) { | ||
// TODO: Allow specifying another card, and in other places |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters