root@node171:/hom '__gnu_cxx :: recurisive_init_error'
what (): std :: exception
root@node171:/home/tmp/gpushare# ld_preload =./libculaunchkernel_override5.so blender -b /home -homestrenceride. -cycles-device cuda
clernate, вызванный после броска экземпляра «__gnu_cxx :: recursive_init_error '
что (): std :: exception
Aborted (ядро сброшено) < /p>
и это мой код C ++. Этот код C ++ будет компилироваться в динамический файл .so.
Это относительная команда
// Командовая команда: g ++ -shared -fpic -o libculaunchkernel_override5.so culaunchkernel_override5.cpp -lcudaunkernel55. -I/usr/local/cuda/include/
// Запуск Команда: ld_preload =././Libculaunchkernel_override5.so blender -b /home/shy/monster/main.blend -e Cycles -f 20 --- Ld_preload =./Libculaunchkernel_override5.so python3 ./runblender.py
Код: Выделить всё
#include "./nvml.h"
#include "./cuda.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define GB_BYTES 0x40000000UL
#define MB_BYTES 0x100000UL
#define INTERCEPTER_LOGO "gpu_partition"
#define INFO_PRT(fmt,...) do{ \
printf("%s - [%s] info:" fmt, INTERCEPTER_LOGO, __func__, ##__VA_ARGS__); \
} while(0)
#define WARN_PRT(fmt,...) do{ \
printf("%s - [%s] warn:" fmt, INTERCEPTER_LOGO, __func__, ##__VA_ARGS__); \
} while(0)
static void* dl_hdl_cn_;
// size_t global_memory_size_ = 2147483648 ;
size_t global_memory_size_ = 4294967296 ; //4GB
size_t total_mem = 0;
typedef struct {
const char *sym_name;
void *func_ptr;
} Entry_hook_t;
static Entry_hook_t g_hooks_entry[] = {
{.sym_name = "cuLaunchKernel", .func_ptr = (void *)cuLaunchKernel},
{.sym_name = "cuMemAlloc_v2", .func_ptr = (void *)cuMemAlloc_v2},
};
std::vector globalInfos;
bool nvml_get_pid_mem() {
nvmlReturn_t result;
nvmlDevice_t device;
unsigned int deviceCount;
globalInfos.clear();
result = nvmlInit();
if (NVML_SUCCESS != result) {
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79497573/i-meet-a-gnu-cxxrecursive-init-error-when-i-try-to-intercept-the-cuda-drive[/url]
Мобильная версия