diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2026-08-10 10:38:14 +0500 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2026-08-10 10:38:14 +0500 |
| commit | 6dc1149d078fc3b04a19696bfb7d5d6940372175 (patch) | |
| tree | 169f7f71e6a292a4ab61a0493000e1add4430f8e /src/cuda.c | |
| parent | 6836426ae183b9a7d0ec99c1e147e8ad6edabd92 (diff) | |
| parent | 80517840f4ae64469721598e8373d81f2e4493dd (diff) | |
Merge tag '6.0.0' of https://repo.dec05eba.com/gpu-screen-recorder into debian
Diffstat (limited to 'src/cuda.c')
| -rw-r--r-- | src/cuda.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -1,9 +1,8 @@ #include "../include/cuda.h" +#include "../include/log.h" #include "../include/library_loader.h" #include <string.h> -#include <stdio.h> #include <dlfcn.h> -#include <assert.h> bool gsr_cuda_load(gsr_cuda *self) { memset(self, 0, sizeof(gsr_cuda)); @@ -13,7 +12,7 @@ bool gsr_cuda_load(gsr_cuda *self) { if(!lib) { lib = dlopen("libcuda.so", RTLD_LAZY); if(!lib) { - fprintf(stderr, "gsr error: gsr_cuda_load failed: failed to load libcuda.so/libcuda.so.1, error: %s\n", dlerror()); + gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_cuda_load failed: failed to load libcuda.so/libcuda.so.1, error: %s", dlerror()); return false; } } @@ -45,7 +44,7 @@ bool gsr_cuda_load(gsr_cuda *self) { CUresult res; if(!dlsym_load_list(lib, required_dlsym)) { - fprintf(stderr, "gsr error: gsr_cuda_load failed: missing required symbols in libcuda.so/libcuda.so.1\n"); + gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_cuda_load failed: missing required symbols in libcuda.so/libcuda.so.1"); goto fail; } @@ -53,14 +52,14 @@ bool gsr_cuda_load(gsr_cuda *self) { if(res != CUDA_SUCCESS) { const char *err_str = "unknown"; self->cuGetErrorString(res, &err_str); - fprintf(stderr, "gsr error: gsr_cuda_load failed: cuInit failed, error: %s (result: %d)\n", err_str, res); + gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_cuda_load failed: cuInit failed, error: %s (result: %d)", err_str, res); goto fail; } int nGpu = 0; self->cuDeviceGetCount(&nGpu); if(nGpu <= 0) { - fprintf(stderr, "gsr error: gsr_cuda_load failed: no cuda supported devices found\n"); + gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_cuda_load failed: no cuda supported devices found"); goto fail; } @@ -70,7 +69,7 @@ bool gsr_cuda_load(gsr_cuda *self) { if(res != CUDA_SUCCESS) { const char *err_str = "unknown"; self->cuGetErrorString(res, &err_str); - fprintf(stderr, "gsr error: gsr_cuda_load failed: unable to get CUDA device, error: %s (result: %d)\n", err_str, res); + gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_cuda_load failed: unable to get CUDA device, error: %s (result: %d)", err_str, res); goto fail; } @@ -78,7 +77,7 @@ bool gsr_cuda_load(gsr_cuda *self) { if(res != CUDA_SUCCESS) { const char *err_str = "unknown"; self->cuGetErrorString(res, &err_str); - fprintf(stderr, "gsr error: gsr_cuda_load failed: unable to create CUDA context, error: %s (result: %d)\n", err_str, res); + gsr_log(GSR_LOG_LEVEL_ERROR, "gsr_cuda_load failed: unable to create CUDA context, error: %s (result: %d)", err_str, res); goto fail; } |
