MCPcopy Create free account
hub / github.com/catboost/catboost / get_cuda_setup_error

Function get_cuda_setup_error

catboost/pytest/lib/__init__.py:50–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49@yatest.common.misc.lazy
50def get_cuda_setup_error():
51 for flag in yatest.common.runtime._get_ya_config().option.flags:
52 if re.match('HAVE_CUDA=(0|no|false)', flag, flags=re.IGNORECASE):
53 return flag
54
55 train = tempfile.NamedTemporaryFile(delete=False)
56 train.write('\n'.join(['%i\t%i' % (x, x + 1) for x in range(10)]) + '\n')
57 train.close()
58 cd = tempfile.NamedTemporaryFile(delete=False)
59 cd.write('0\tTarget\n')
60 cd.close()
61 try:
62 cmd = (get_catboost_binary_path(), 'fit',
63 '--task-type', 'GPU',
64 '--devices', '0',
65 '-i', '2',
66 '-f', train.name,
67 '--column-description', cd.name
68 )
69 yatest.common.execute(cmd)
70 except Exception as e:
71 for reason in ['GPU support was not compiled', 'CUDA driver version is insufficient']:
72 if reason in str(e):
73 return reason
74 return str(e)
75 finally:
76 os.unlink(train.name)
77 os.unlink(cd.name)
78
79 return None
80
81
82def run_nvidia_smi():

Callers

nothing calls this directly

Calls 9

get_catboost_binary_pathFunction · 0.85
unlinkMethod · 0.80
rangeFunction · 0.50
strClass · 0.50
matchMethod · 0.45
writeMethod · 0.45
joinMethod · 0.45
closeMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected