Skip to content

Commit

Permalink
Fix windows dll search path in python 3.8 (apache#18362)
Browse files Browse the repository at this point in the history
  • Loading branch information
yajiedesign authored and chinakook committed Jul 24, 2020
1 parent 240ac87 commit ad7c53b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/mxnet/libinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os
import platform
import logging

import sys

def find_lib_path(prefix='libmxnet'):
"""Find MXNet dynamic library files.
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit ad7c53b

Please sign in to comment.