chore: uncucked gpuminer

This commit is contained in:
Nick 2025-12-02 03:30:54 -06:00
parent 452583cf44
commit ca65436dfb

View file

@ -232,13 +232,23 @@ in
export CC=${gccCompiler}/bin/gcc
export CXX=${gccCompiler}/bin/g++
# Point nvcc to GCC 13 headers for compilation
export CPATH=${gccCompiler}/include/c++/${gccCompiler.version}:${cudaPackages.cudatoolkit}/include:$CPATH
export C_INCLUDE_PATH=${cudaPackages.cudatoolkit}/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=${gccCompiler}/include/c++/${gccCompiler.version}:${cudaPackages.cudatoolkit}/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=${cudaPackages.cudatoolkit}/lib:$LIBRARY_PATH
# CRITICAL: Force nvcc to use GCC 13 by creating a wrapper script
# The wrapper must pass both --compiler-bindir and ensure CUDA headers are found
mkdir -p /tmp/nvcc-wrapper
cat > /tmp/nvcc-wrapper/nvcc <<WRAPPER_EOF
#!${pkgs.bash}/bin/bash
# Add CUDA include path to help nvcc find cuda_runtime.h
exec ${cudaPackages.cudatoolkit}/bin/nvcc \\
--compiler-bindir ${gccCompiler}/bin \\
-I${cudaPackages.cudatoolkit}/include \\
"\$@"
WRAPPER_EOF
chmod +x /tmp/nvcc-wrapper/nvcc
# CRITICAL: Use GCC 14 runtime libraries for CXXABI_1.3.15 at runtime
# Put our wrapper at the front of PATH
export PATH="/tmp/nvcc-wrapper:$PATH"
# Use GCC 14 runtime libraries for CXXABI_1.3.15 at runtime
export LD_LIBRARY_PATH=${
lib.makeLibraryPath [
cudaPackages.cudatoolkit
@ -266,6 +276,7 @@ in
echo "Compile-time GCC: ${gccCompiler}/bin/gcc ($(${gccCompiler}/bin/gcc --version | head -n1))"
echo "Runtime GCC library: ${gccRuntime.cc.lib}/lib"
echo "Working directory: $(pwd)"
echo "NVCC wrapper: $(type -p nvcc)"
# Verify the critical library is available
echo "Checking for CXXABI_1.3.15..."
@ -275,10 +286,13 @@ in
echo " WARNING: CXXABI_1.3.15 not found"
fi
# Test nvcc compilation
echo "Testing nvcc compiler configuration..."
/tmp/nvcc-wrapper/nvcc --version
# Run the miner
exec venv/bin/python main.py --workers ${builtins.toString cfg.maxWorkers} 2>&1
'';
StandardOutput = "journal";
StandardError = "journal";
};