This commit is contained in:
Osman Faruk Bayram 2025-08-27 00:34:21 +03:00
parent 4bab842687
commit 347d5c6554

View file

@ -29,15 +29,17 @@
packages."${system}" = { packages."${system}" = {
# just one main.cu file for now # just one main.cu file for now
# compile it and place it to $out/bin/cuda-kernel # compile it and place it to $out/bin/cuda-kernel
cuda-kernel = pkgs.stdenv.mkDerivation { cuda-kernel = pkgs.cudaPackages.backendStdenv.mkDerivation {
name = "cuda-kernel"; name = "cuda-kernel";
src = ./.; src = ./.;
buildInputs = with pkgs; [ buildInputs = with pkgs; [
cudatoolkit cudatoolkit
cudaPackages.cuda_cudart cudaPackages.cuda_cudart
linuxPackages.nvidia_x11 linuxPackages.nvidia_x11_beta
]; ];
LD_LIBRARY_PATH = "${pkgs.linuxPackages.nvidia_x11}/lib"; cudaSupport = true;
requiredSystemFeatures = [ "cuda" ];
LD_LIBRARY_PATH = "${pkgs.linuxPackages.nvidia_x11_beta}/lib";
buildPhase = '' buildPhase = ''
nvcc -o main main.cu nvcc -o main main.cu
mkdir -p $out/bin mkdir -p $out/bin