This is an automated email from the ASF dual-hosted git repository.
lausen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 915b821 Fix windows dll search path in python 3.8 (#18362)
915b821 is described below
commit 915b821fe99b18735e658f19bff76e8fc3b58c3d
Author: Hu Shiwen <[email protected]>
AuthorDate: Thu May 21 03:15:32 2020 +0800
Fix windows dll search path in python 3.8 (#18362)
---
python/mxnet/libinfo.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/python/mxnet/libinfo.py b/python/mxnet/libinfo.py
index 7333822..5f65df3 100644
--- a/python/mxnet/libinfo.py
+++ b/python/mxnet/libinfo.py
@@ -20,7 +20,7 @@
import os
import platform
import logging
-
+import sys
def find_lib_path(prefix='libmxnet'):
"""Find MXNet dynamic library files.
@@ -73,6 +73,11 @@ def find_lib_path(prefix='libmxnet'):
'List of candidates:\n' + str('\n'.join(dll_path)))
if os.name == 'nt':
os.environ['PATH'] = os.environ['PATH'] + ';' +
os.path.dirname(lib_path[0])
+ if sys.version_info >= (3, 8):
+ if 'CUDA_PATH' not in os.environ:
+ raise RuntimeError('Cannot find the env CUDA_PATH.Please set
CUDA_PATH env with cuda path')
+ os.add_dll_directory(os.path.dirname(lib_path[0]))
+ os.add_dll_directory(os.path.join(os.environ['CUDA_PATH'], 'bin'))
return lib_path
def find_include_path():