Talk:NVIDIA: Difference between revisions

From NixOS Wiki
imported>ZerataX
Created page with "I have a few issues with the '''By making a FHS user env''' section first of some characters get replaced by html entities which makes it annoying to copy the example and I'm..."
 
imported>ZerataX
LIBGLU_combined replaced by LIBGLU AND LIBGL
Line 26: Line 26:
                 cudatoolkit
                 cudatoolkit
                 linuxPackages.nvidia_x11
                 linuxPackages.nvidia_x11
                 libGLU_combined
                 libGLU
                libGL
xorg.libXi xorg.libXmu freeglut
xorg.libXi xorg.libXmu freeglut
                 xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib  
                 xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib  
Line 53: Line 54:
<syntaxhighlight lang="bash">export PATH=$CUDA_PATH:$PATH</syntaxhighlight>
<syntaxhighlight lang="bash">export PATH=$CUDA_PATH:$PATH</syntaxhighlight>
since otherwise {{ic|cicc}} wouldn't be found
since otherwise {{ic|cicc}} wouldn't be found
Also {{ic|LIBGLU_combined}} has been removed since 20.03, see https://github.com/NixOS/nixpkgs/pull/73261#issue-339663290

Revision as of 21:11, 27 April 2020

I have a few issues with the By making a FHS user env section

first of some characters get replaced by html entities which makes it annoying to copy the example and I'm not sure how to avoid that when editing the page, specifically <nixpkgs>. Strangely I can't recreate this behavior here.

Furthermore I changed the file like so:

cuda-fsh.nix
{ pkgs ? import &lt;nixpkgs&gt; {} }:

let fhs = pkgs.buildFHSUserEnv {
        name = "cuda-env";
        targetPkgs = pkgs: with pkgs;
               [ git
                 gitRepo
                 gnupg
                 autoconf
                 curl
                 procps
                 gnumake
                 gcc7
                 utillinux
                 m4
                 gperf
                 unzip
                 cudatoolkit
                 linuxPackages.nvidia_x11
                 libGLU
                 libGL
		 xorg.libXi xorg.libXmu freeglut
                 xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib 
		 ncurses5
		 stdenv.cc
		 binutils
                ];
          multiPkgs = pkgs: with pkgs; [ zlib ];
          runScript = "bash";
          profile = ''
                  export CUDA_PATH=${pkgs.cudatoolkit}
                  export PATH=$CUDA_PATH:$PATH
                  # export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib
		  export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
		  export EXTRA_CCFLAGS="-I/usr/include"
            '';
          };
in pkgs.stdenv.mkDerivation {
   name = "cuda-env-shell";
   nativeBuildInputs = [ fhs ];
   shellHook = "exec cuda-env";
}

adding gcc7 since it otherwise nvcc wouldn't work and adding

export PATH=$CUDA_PATH:$PATH

since otherwise cicc wouldn't be found

Also LIBGLU_combined has been removed since 20.03, see https://github.com/NixOS/nixpkgs/pull/73261#issue-339663290