davisking/dlib

Choose backend (GPU/CPU)

Aberta

#1.852 aberto em 31 de jul. de 2019

 (12 comentários) (1 reação) (0 responsável)C++ (3.442 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (14.434 estrelas)
Métricas de merge de PR
 (Mesclagem média 3h 56m) (2 fundiu PRs em 30d)

Description

So I couldn't find a way to do this in the documentation but I was wondering if there was a way to force dlib to use the CPU if it's built with CUDA enabled? I ask because I'm making a multithreaded application with dlib and only a maximum of 2 threads at a time can use CUDA (because of limitations of the GPU itself). So I'd like to in a thread get dlib to use the GPU in the thread if <2 threads are using the GPU and otherwise fallback to using the CPU.

Also a slightly related question how would dlib cope with a machine with multiple GPUs installed all for compute purposes?

Guia do colaborador