Tensorflow: Difference between revisions

imported>Biggs
m Note about changing python version to be up to date
imported>Samuela
No edit summary
Line 1: Line 1:
== Tensorflow ==
== Tensorflow ==
There several possible ways to install tensorflow.


There several possible ways to install tensorflow. Nixpkgs provides multiple versions, however, it is often desirable to be able to install the latest nightly from pip. This can accomplished in the following ways:
=== Nix-native packages (recommended) ===
Use <code>python3Packages.tensorflow</code> or <code>python3Packages.tensorflowWithCuda</code>.
 
=== pip install in a nix-shell ===
Nixpkgs provides multiple versions, however, it is often desirable to be able to install the latest nightly from pip. This can accomplished in the following ways:


* By making a nix-shell
* By making a nix-shell
Line 24: Line 29:
</syntaxhighlight>
</syntaxhighlight>


Within this shell, pip install tf-nightly should work and provide GPU support. The cuda toolkit version (and the version of Python) can be changed to correspond with the matching tensorflow version.
Within this shell, <code>pip install tf-nightly</code> should work and provide GPU support. The cuda toolkit version (and the version of Python) can be changed to correspond with the matching tensorflow version.


Note: On NixOS 20.03 and above LD_LIBRARY_PATH no longer contains /run/opengl-driver/lib:/run/opengl-driver-32/lib by default, preventing tensorflow from discovering the Cuda libraries. This can be solved by manually (or using nixGL[https://github.com/guibou/nixGL] ) appending your LD_LIBRARY_PATH in the shellHook, or by reverting to the pre-20.03 behavior by setting setLdLibraryPath to true in your hardware opengl configuration under configuration.nix.
Note: On NixOS 20.03 and above LD_LIBRARY_PATH no longer contains /run/opengl-driver/lib:/run/opengl-driver-32/lib by default, preventing tensorflow from discovering the Cuda libraries. This can be solved by manually (or using nixGL[https://github.com/guibou/nixGL] ) appending your LD_LIBRARY_PATH in the shellHook, or by reverting to the pre-20.03 behavior by setting setLdLibraryPath to true in your hardware opengl configuration under configuration.nix.