Jump to content

Tensorflow: Difference between revisions

no edit summary
imported>Samuela
No edit summary
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.  


=== Nix-native packages (recommended) ===
== Nix-native packages (strongly recommended) ==
Use <code>python3Packages.tensorflow</code> or <code>python3Packages.tensorflowWithCuda</code>.
Use <code>python3Packages.tensorflow</code> or <code>python3Packages.tensorflowWithCuda</code>.


=== pip install in a nix-shell ===
'''Cache''': Using the [https://app.cachix.org/cache/cuda-maintainers#pull cuda-maintainers cache] is recommended! It will save you valuable time and electrons. Getting set up should be as simple as <code>cachix use cuda-maintainers</code>. See the [[CUDA]] wiki page for more info.
 
== 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:
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:


Line 32: Line 34:


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.


  hardware.opengl.setLdLibraryPath = true;
  hardware.opengl.setLdLibraryPath = true;


== See also ==
== See also ==


* [https://discourse.nixos.org/t/installing-python-modules-from-pip-buildfhsuserenv-for-python-tutorial/5704/13]
* [https://discourse.nixos.org/t/installing-python-modules-from-pip-buildfhsuserenv-for-python-tutorial/5704/13]
Anonymous user