mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-22 06:23:20 -07:00
Merge pull request #29 from faceshiftlabs/feat/plaidML-os-x
Allows PlaidML to work on OS X with AMD cards
This commit is contained in:
commit
5179268b01
1 changed files with 12 additions and 11 deletions
|
@ -282,14 +282,15 @@ def get_plaidML_devices():
|
|||
plaidML_devices = []
|
||||
# Using plaidML OpenCL backend to determine system devices and has_nvidia_device
|
||||
try:
|
||||
os.environ['PLAIDML_EXPERIMENTAL'] = 'false' #this enables work plaidML without run 'plaidml-setup'
|
||||
os.environ['PLAIDML_EXPERIMENTAL'] = 'true' #this enables work plaidML without run 'plaidml-setup'
|
||||
import plaidml
|
||||
ctx = plaidml.Context()
|
||||
for d in plaidml.devices(ctx, return_all=True)[0]:
|
||||
for devices in plaidml.devices(ctx, return_all=True):
|
||||
for d in devices:
|
||||
details = json.loads(d.details)
|
||||
if details['type'] == 'CPU': #skipping opencl-CPU
|
||||
if 'type' not in details or details['type'] == 'CPU': #skipping opencl-CPU
|
||||
continue
|
||||
if 'nvidia' in details['vendor'].lower():
|
||||
if 'vendor' in details and 'nvidia' in details['vendor'].lower():
|
||||
has_nvidia_device = True
|
||||
plaidML_devices += [ {'id':d.id,
|
||||
'globalMemSize' : int(details['globalMemSize']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue