Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyOptix on Windows #2

Open
peggers opened this issue Apr 8, 2017 · 6 comments
Open

PyOptix on Windows #2

peggers opened this issue Apr 8, 2017 · 6 comments

Comments

@peggers
Copy link

peggers commented Apr 8, 2017

Hej!
I cannot make PyOptix run on Windows. Can anyone give me a hint which things I have to change to make it run?

@ozen
Copy link
Owner

ozen commented Apr 10, 2017 via email

@peggers
Copy link
Author

peggers commented Apr 10, 2017

http://stackoverflow.com/questions/43300055/installation-failure-cannot-find-startupinfo
This is the problem I got on Windows. I installed Ubuntu now and am at the stage when I install the Optix SDK. How do I put nvcc in PATH and how do I put the libraries in ldconfig?
I have some basic ubuntu knowledge, but it is unfortunately a bit rusty.

@ozen
Copy link
Owner

ozen commented Apr 10, 2017

Seeing the error has refreshed my memory. setup.py script runs linux-specific commands to find the dependencies. So it fails in Windows straight away.

As for paths to dependencies in Linux,
CUDA, OptiX, and Boost.Python are required during compilation, and they are searched using ldconfig and LD_LIBRARY_PATH. ldconfig is a program that is used to manage shared libraries. LD_LIBRARY_PATH is an environment variable which you set to give the library loader (ld.so) an extra set of directories to look for when searching for shared libraries. Path to nvcc binary must be in PATH. PATH is an environment variable specifying a set of directories where executable programs are located. So if you run nvcc, the operating system will search nvcc binary in those directories. It is required to PyOptiX's PTX generation feature to work and is located and saved in a conf file during the setup.

When you install Boost.Python using Ubuntu's package manager, it will probably configure ldconfig automatically so you don't need to worry about that. Since you probably install CUDA and OptiX manually, lets add their paths to the environment variables. I have written the following commands assuming:

  • CUDA is installed in /usr/local/cuda
  • OptiX is installed in /usr/local/optix

If you put them somewhere else, either create symlinks, or change the following commands accordingly.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/optix/lib64
export PATH=$PATH:/usr/local/cuda/bin

Edit: These paths may be used during run time as well. export command changes the environment variables for that session only. To make them persistent you need to modify a profile file. Please check out this web page, specifically Persistent environment variables section to learn more about environment variables in Ubuntu.

@peggers
Copy link
Author

peggers commented Apr 10, 2017

Ok, thank you very much for the the good explanation. Indeed I installed Optix to somewhere else, but created a symlink.
by running echo $LD_LIBRARY_PATH and echo $PATH I can see, that the variables are added. But then, while installing PyOptiX, it cannot find nvcc:
sudo python setup.py install Traceback (most recent call last): File "setup.py", line 193, in <module> main() File "setup.py", line 156, in main sources, include_dirs, library_dirs, libraries = extension_prebuild() File "setup.py", line 105, in extension_prebuild raise OSError('nvcc is not in PATH') OSError: nvcc is not in PATH

@peggers
Copy link
Author

peggers commented Apr 10, 2017

Ok, I think managed to install it. But now I face some problems running the examples. Running hello.py with python (2.7) gives me this output
python hello.py

Traceback (most recent call last):
  File "hello.py", line 8, in <module>
    from examples.common import ImageWindow
ImportError: No module named examples.common

and with python 3:

Traceback (most recent call last):
  File "hello.py", line 7, in <module>
    from pyoptix import Context, Buffer, Program, EntryPoint, Compiler
  File "/usr/local/lib/python3.5/dist-packages/pyoptix/__init__.py", line 1, in <module>
    from .acceleration import Acceleration
  File "/usr/local/lib/python3.5/dist-packages/pyoptix/acceleration.py", line 2, in <module>
    from pyoptix.context import current_context
  File "/usr/local/lib/python3.5/dist-packages/pyoptix/context.py", line 3, in <module>
    from pyoptix._driver import NativeContextWrapper
ImportError: dynamic module does not define module export function (PyInit__driver)

@ozen
Copy link
Owner

ozen commented Apr 10, 2017

Python 3 problem seems like the extension has not been compiled correctly for Python 3.
Python 2 problem may be my mistake, I will look into it as soon as possible. In the meantime, try running the following commands in pyoptix directory:

python examples/hello/hello.py

or

python -m examples.hello.hello

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants