mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-08-19 21:13:21 -07:00
import cupy on demand , because it eats almost 2Gb paging file in every subprocess
This commit is contained in:
parent
1a47d99278
commit
b546c735a1
3 changed files with 56 additions and 50 deletions
|
@ -1,6 +1,6 @@
|
|||
from typing import List
|
||||
|
||||
import cupy as cp
|
||||
|
||||
|
||||
|
||||
class CuPyDeviceInfo:
|
||||
|
@ -55,6 +55,7 @@ def get_available_devices() -> List[CuPyDeviceInfo]:
|
|||
"""
|
||||
global _cupy_devices
|
||||
if _cupy_devices is None:
|
||||
import cupy as cp # BUG eats 1.8Gb paging file per process, so import on demand
|
||||
devices = []
|
||||
|
||||
for i in range (cp.cuda.runtime.getDeviceCount()):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue