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

Add Nvidia libraries to Unix exclusion list #7746

Merged

Conversation

SnoopJ
Copy link
Contributor

@SnoopJ SnoopJ commented Jul 1, 2023

This changeset adds several Nvidia libraries to PyInstaller's list of excluded libraries, which fixes the issue reported in #7745 in the manner suggested by @rokm.

The libraries added by this PR are a subset of what is listed in the Nvidia driver documentation for one of the recently release driver versions as of the time of this PR. I did check some historical versions and though there are a few libraries present in older drivers that are not covered by this change, the libraries listed here seem to be stable features of the stack.

Note that I have explicitly left out any libraries related to CUDA or OpenCL which are reasonably likely candidates for inclusion in a PyInstaller application, and which have decent forward compatibility as far as I know.


The specific case that led me to file this PR and which I used to test its efficacy is a PyInstaller application that has a dependency pynvml, which induces a dependency (via ctypes) on libnvidia-ml that can cause mismatches if the application is run on a system with a different driver version than the system that built the PyInstaller distribution.

@rokm
Copy link
Member

rokm commented Jul 1, 2023

Looks good!

Please add a news fragment for the changelog, and then we're good to merge. (I suppose the change could be classified as either bugfix or core).

@SnoopJ
Copy link
Contributor Author

SnoopJ commented Jul 1, 2023

Done. I went with bugfix since from where I'm standing it feels like a bug that libnvidia-ml ended up in the distribution when using pynvml.

As a historical note to anyone who might be reading this PR because they're stuck with Python 3.7, if you want to update the exclusion list at runtime, you need to change not only the _unix_excludes list, but also need to regenerate the ExcludeList instance that relies on it (making that class's regex lazy might be a good related feature request, though)

@bwoodsend bwoodsend enabled auto-merge (squash) July 1, 2023 16:28
@bwoodsend bwoodsend merged commit 45bb271 into pyinstaller:develop Jul 1, 2023
18 checks passed
@SnoopJ SnoopJ deleted the bugfix/exclude-nvidia-driver-libraries branch July 2, 2023 01:37
bwoodsend pushed a commit to bwoodsend/pyinstaller that referenced this pull request Aug 26, 2023
While packaging an application that uses pynvml on Linux, the library 
libnvidia-ml.so.1 may be bundled into the resulting application. This 
library is part of the Nvidia driver stack and this behavior creates 
an incompatibility if the packaging system and runtime system do not 
have the same driver version (or are compatible in some vague sense I 
don't understand).

For my application and I assume pretty much every application that 
might want to bundle pynvml this way, libnvidia-ml.so.1 should be 
excluded from the final distribution.
bwoodsend pushed a commit that referenced this pull request Aug 26, 2023
While packaging an application that uses pynvml on Linux, the library 
libnvidia-ml.so.1 may be bundled into the resulting application. This 
library is part of the Nvidia driver stack and this behavior creates 
an incompatibility if the packaging system and runtime system do not 
have the same driver version (or are compatible in some vague sense I 
don't understand).

For my application and I assume pretty much every application that 
might want to bundle pynvml this way, libnvidia-ml.so.1 should be 
excluded from the final distribution.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2023
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.

None yet

3 participants