davisking/dlib

Choose backend (GPU/CPU)

開放

#1,852 建立於 2019年7月31日

 (12 則留言) (1 個反應) (0 位負責人)C++ (3,442 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (14,434 顆星)
PR 合併指標
 (平均合併 3小時 56分鐘) (30 天內合併 2 個 PR)

描述

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?

貢獻者指南