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

Update pip.md #2299

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Update pip.md #2299

wants to merge 9 commits into from

Conversation

sgkouzias
Copy link

Specify additional steps to utilize GPU for Linux users

Specify additional steps to utilize GPU for Linux users
Advice to skip additional step 6 if using CPU.
@8bitmp3
Copy link
Contributor

8bitmp3 commented Apr 9, 2024

@MarkDaoust @markmcd

Added second option to create virtual env via Python's built in venv module for Linux users with CUDA-enabled GPUs
Added virtual envs activation/deactivation commands and changed wording for editing the deactivate block in the activate script of the venv virtual env.
Added instructions to resolve the ptxas issue.
Revised CUDNN_DIR definition
Corrected LD_LIBRARY_PATH definition in conda environment instructions
Rename environment variable to PTXAS_DIR and package manager options.
Added note to use pip instead of conda to install TensorFlow.
Copy link
Author

@sgkouzias sgkouzias left a comment

Choose a reason for hiding this comment

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

Added steps and respective instructions to install TensorFlow by running the pip install tensorflow[and-cuda] command within a virtual environment (option #1: conda, option #2: venv) and set environment variables to find/locate compatible NVIDIA libs installed with TensorFlow to effectively utilize GPUs. The solution has been successfully tested.

Reference: tensorflow/tensorflow#63362

@sgkouzias
Copy link
Author

sgkouzias commented May 10, 2024

@haifeng-jin , @MarkDaoust, @8bitmp3 I await any suggestions or revisions if needed. Do we have any updates?

@sgkouzias sgkouzias marked this pull request as draft May 16, 2024 13:23
@sgkouzias sgkouzias marked this pull request as ready for review May 16, 2024 13:28
@haifeng-jin
Copy link
Collaborator

As I remembered, the current recommended way to install TF is to use pip. I do not have further info on this. @MarkDaoust may comment on this.

@sgkouzias
Copy link
Author

sgkouzias commented May 20, 2024

As I remembered, the current recommended way to install TF is to use pip. I do not have further info on this. @MarkDaoust may comment on this.

@haifeng-jin it seems practically impossible for someone owning a PC with CUDA-enabled GPU to perform deep learning experiments with TensorFlow version 2.16.1 and utilize his GPU locally without manually performing some extra steps not included (until today) in the official TensorFlow documentation of the standard installation procedure of TensorFlow for Linux users with GPUs at least as a temporal fix!

It turns out that when you pip install tensorflow[and-cuda] all required NVIDIA libraries are installed as well. You just need to configure manually the environment variables as appropriate in order to utilize them and run TensorFlow with GPU.

Copy link
Contributor

@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

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

Please don't use "add file"/"update file"/"fix file"/etc. commit messages. These are hard to reason about when looking at the history of the file/repository. Instead, please write explanatory git commit messages.

The commit message is also the title of the PR if the PR has only one commit. It is thus twice important to have commit messages that are relevant, as PRs would be easier to understand and easier to analyze in search results.

For how to write good quality git commit messages, please consult https://cbea.ms/git-commit/

@mihaimaruseac
Copy link
Contributor

It turns out that when you pip install tensorflow[and-cuda] all required NVIDIA libraries are installed as well. You just need to configure manually the environment variables as appropriate in order to utilize them and run TensorFlow with GPU.

Can we instead add these to the install guide?

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