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

BugFix: Manually specify directory to load nvrtc dll on pyflamegpu import. #880

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

Robadob
Copy link
Member

@Robadob Robadob commented Jun 28, 2022

Required for some Windows installs where Python >=3.8.

Have tested it with Python 3.7.x and 3.9.x locally, however I could never reproduce the original bug.

Fix inspired by @zeyus

Closes #450

…port.

Required for some Windows installs where Python >=3.8.

Fix inspired by zeyus

Closes #450
@Robadob Robadob requested a review from ptheywood June 28, 2022 11:26
@Robadob Robadob self-assigned this Jun 28, 2022
@Robadob
Copy link
Member Author

Robadob commented Jun 28, 2022

I'd appreciate it if you can confirm this solves it for you @zeyus (GitHub doesn't seem to allow me to invite you to review the PR)

It's a bit more complicated than your proposed solution, but I think it should hopefully work for users with many verisons of CUDA installed. I don't believe python actually wipes the path variable, hence where should allow us to find the preferred copy of the dll.

@Robadob
Copy link
Member Author

Robadob commented Jun 28, 2022

cc @jcbpyle This may also be relevant to you. If you're still affected by the issue can you test this too?

@jcbpyle
Copy link

jcbpyle commented Jun 28, 2022

Works on a fresh build for me, all cmake config/generation/ vstudio building worked without a problem. The venv environment needed a few packages installing (numpy and deap which I use in an experiment generator module when doing boids stuff, so probably unrelated) and it didn't like 'python3 -m ...' but after installing those packages and using 'python -m ...' all worked fine.

@Robadob
Copy link
Member Author

Robadob commented Jun 28, 2022

Great, those things should be unrelated to this change. Will get it merged once @ptheywood has confirmed he's happy with it.

@Robadob Robadob merged commit 8627ede into master Jun 28, 2022
@Robadob Robadob deleted the dll_not_found branch June 28, 2022 14:23
@zeyus
Copy link

zeyus commented Jun 28, 2022

I'd appreciate it if you can confirm this solves it for you @zeyus (GitHub doesn't seem to allow me to invite you to review the PR)

Huh, strange, maybe I have to be a collaborator or something. I'll pull the changes and build it now :) thanks

@Robadob
Copy link
Member Author

Robadob commented Jun 28, 2022

Huh, strange, maybe I have to be a collaborator or something. I'll pull the changes and build it now :) thanks

image

Probably, I think non-collaborators can still review though (they just get a grey tick, rather than a green tick). Last year we had an issue where some bot kept approving a temporarily inactive PR for no reason.

@zeyus
Copy link

zeyus commented Jun 29, 2022

UPDATE:

I ran the dependency tree again, and it turns out this is not the same issue, rather, libpng16.dll was not found (I guess my compiled version is not in the bin / path).

Your update / fix works fine :) 👍

So, @Robadob, this doesn't introduce any new bugs, but for some reason it doesn't actually fix the importerror, which might indicate a restriction on a module's ability to use os.add_dll_directory ?

@Robadob
Copy link
Member Author

Robadob commented Jun 29, 2022

Iirc, libpng is an optional dependency of the visualiser. CMake only builds with it if it can find it on your system, so it's probably not in the pre-built binaries from CI.

It's possible this is the same bug for a different dll, would just need to add logic for that too. I will add a note to the closed issue. Although, it probably has a more permissive license that would allow us to package it's dll like we do SDL2.

Thanks for your input, has been very useful.

@zeyus
Copy link

zeyus commented Jun 29, 2022

That's fair, I did have libpng with vcpkg, but the vcpkg bin path is definitely not in my PATH variable.

Yeah I think that makes sense, and no probs happy to help, I'll definitely raise any issues I bump into along the way, this seems like a great ABM tool, and I'm going to be implementing it for one of my exam papers, thanks for the awesome support.

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

Successfully merging this pull request may close these issues.

dll load failed
4 participants