Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix windows dll search path in python 3.8 #18362

Merged
merged 2 commits into from
May 20, 2020
Merged

Conversation

yajiedesign
Copy link
Contributor

Description

fix windows dll search path in python 3.8

Reference

https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew

Changes

Comments

@yajiedesign yajiedesign requested a review from szha as a code owner May 19, 2020 01:32
@mxnet-bot
Copy link

Hey @yajiedesign , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [sanity, windows-gpu, miscellaneous, unix-cpu, centos-gpu, centos-cpu, edge, windows-cpu, unix-gpu, website, clang]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@yajiedesign
Copy link
Contributor Author

@mxnet-bot run ci [ci/jenkins/mxnet-validation/miscellaneous]

@mxnet-bot
Copy link

None of the jobs entered are supported.
Jobs entered by user: [ci/jenkins/mxnet-validation/miscellaneous]
CI supported Jobs: [miscellaneous, unix-cpu, centos-gpu, clang, centos-cpu, windows-gpu, website, sanity, unix-gpu, edge, windows-cpu]

@yajiedesign
Copy link
Contributor Author

@mxnet-bot run ci [miscellaneous]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [miscellaneous]

@leezu
Copy link
Contributor

leezu commented May 19, 2020

@mxnet-bot run ci [miscellaneous]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [miscellaneous]

@@ -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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thus mxnet won't work on Windows as long as users don't set up this environment variable? Or is it provided by default by cuda?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cuda default provided.

@@ -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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more pythonic to use try-except syntax and just attempt to call add_dll_directory
It will ensure compatibility with interpreters different to cpython

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the version here because only 3.8 or above needs to call this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nevertheless bad practice as there are other python interpreters with different versioning schemes

@leezu leezu merged commit 915b821 into apache:master May 20, 2020
AntiZpvoh pushed a commit to AntiZpvoh/incubator-mxnet that referenced this pull request Jul 6, 2020
chinakook pushed a commit to chinakook/mxnet that referenced this pull request Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants