aboutsummaryrefslogtreecommitdiff
path: root/src/cuda.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-05 01:59:04 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-05 10:33:47 +0200
commitb9fa7f2fa25ee37c87077bce468c95e48fce5c18 (patch)
tree3aff293110d8405e8057edb9c757f6e630c22de2 /src/cuda.c
parent62d61fda12e3774fee6b671e44fb89bd2ef8da8c (diff)
Separate video encoding method from capture method
With this instead of kms_cuda/kms_vaapi/kms_software and xcomposite_cuda/xcomposite_vaapi/xcomposite_software there is now only kms and xcomposite.
Diffstat (limited to 'src/cuda.c')
-rw-r--r--src/cuda.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cuda.c b/src/cuda.c
index 6d685b5..23954a4 100644
--- a/src/cuda.c
+++ b/src/cuda.c
@@ -19,7 +19,7 @@ bool gsr_cuda_load(gsr_cuda *self, Display *display, bool do_overclock) {
}
}
- dlsym_assign required_dlsym[] = {
+ const dlsym_assign required_dlsym[] = {
{ (void**)&self->cuInit, "cuInit" },
{ (void**)&self->cuDeviceGetCount, "cuDeviceGetCount" },
{ (void**)&self->cuDeviceGet, "cuDeviceGet" },
@@ -82,12 +82,13 @@ bool gsr_cuda_load(gsr_cuda *self, Display *display, bool do_overclock) {
goto fail;
}
- if(self->do_overclock) {
- assert(display);
+ if(self->do_overclock && display) {
if(gsr_overclock_load(&self->overclock, display))
gsr_overclock_start(&self->overclock);
else
fprintf(stderr, "gsr warning: gsr_cuda_load: failed to load xnvctrl, failed to overclock memory transfer rate\n");
+ } else if(self->do_overclock && !display) {
+ fprintf(stderr, "gsr warning: gsr_cuda_load: overclocking enabled but no X server is running. Overclocking has been disabled\n");
}
self->library = lib;