mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
chore: uncucked gpuminer
This commit is contained in:
parent
452583cf44
commit
ca65436dfb
1 changed files with 63 additions and 49 deletions
|
|
@ -220,65 +220,79 @@ in
|
||||||
|
|
||||||
# Main execution script
|
# Main execution script
|
||||||
ExecStart = pkgs.writeShellScript "run-gpu-miner" ''
|
ExecStart = pkgs.writeShellScript "run-gpu-miner" ''
|
||||||
set -e
|
set -e
|
||||||
cd ${cfg.dataDir}/GPU-Miner
|
cd ${cfg.dataDir}/GPU-Miner
|
||||||
|
|
||||||
# Set CUDA environment
|
# Set CUDA environment
|
||||||
export CUDA_PATH=${cudaPackages.cudatoolkit}
|
export CUDA_PATH=${cudaPackages.cudatoolkit}
|
||||||
export CUDA_ROOT=${cudaPackages.cudatoolkit}
|
export CUDA_ROOT=${cudaPackages.cudatoolkit}
|
||||||
export CUDA_HOME=${cudaPackages.cudatoolkit}
|
export CUDA_HOME=${cudaPackages.cudatoolkit}
|
||||||
|
|
||||||
# Use GCC 13 for CUDA compilation (compatible with CUDA 12.8)
|
# Use GCC 13 for CUDA compilation (compatible with CUDA 12.8)
|
||||||
export CC=${gccCompiler}/bin/gcc
|
export CC=${gccCompiler}/bin/gcc
|
||||||
export CXX=${gccCompiler}/bin/g++
|
export CXX=${gccCompiler}/bin/g++
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Put our wrapper at the front of PATH
|
||||||
|
export PATH="/tmp/nvcc-wrapper:$PATH"
|
||||||
|
|
||||||
# Point nvcc to GCC 13 headers for compilation
|
# Use GCC 14 runtime libraries for CXXABI_1.3.15 at runtime
|
||||||
export CPATH=${gccCompiler}/include/c++/${gccCompiler.version}:${cudaPackages.cudatoolkit}/include:$CPATH
|
export LD_LIBRARY_PATH=${
|
||||||
export C_INCLUDE_PATH=${cudaPackages.cudatoolkit}/include:$C_INCLUDE_PATH
|
lib.makeLibraryPath [
|
||||||
export CPLUS_INCLUDE_PATH=${gccCompiler}/include/c++/${gccCompiler.version}:${cudaPackages.cudatoolkit}/include:$CPLUS_INCLUDE_PATH
|
cudaPackages.cudatoolkit
|
||||||
export LIBRARY_PATH=${cudaPackages.cudatoolkit}/lib:$LIBRARY_PATH
|
config.boot.kernelPackages.nvidiaPackages.latest
|
||||||
|
gccRuntime.cc.lib # GCC 14 for runtime
|
||||||
|
pkgs.zlib
|
||||||
|
pkgs.glib
|
||||||
|
pkgs.glibc
|
||||||
|
]
|
||||||
|
}
|
||||||
|
# Add gpu_core binaries to library path
|
||||||
|
export LD_LIBRARY_PATH="$PWD/gpu_core/bin/linux:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
# CRITICAL: Use GCC 14 runtime libraries for CXXABI_1.3.15 at runtime
|
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||||
export LD_LIBRARY_PATH=${
|
export GBM_BACKEND=nvidia-drm
|
||||||
lib.makeLibraryPath [
|
|
||||||
cudaPackages.cudatoolkit
|
|
||||||
config.boot.kernelPackages.nvidiaPackages.latest
|
|
||||||
gccRuntime.cc.lib # GCC 14 for runtime
|
|
||||||
pkgs.zlib
|
|
||||||
pkgs.glib
|
|
||||||
pkgs.glibc
|
|
||||||
]
|
|
||||||
}
|
|
||||||
# Add gpu_core binaries to library path
|
|
||||||
export LD_LIBRARY_PATH="$PWD/gpu_core/bin/linux:$LD_LIBRARY_PATH"
|
|
||||||
|
|
||||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
# Verify GPU accessibility
|
||||||
export GBM_BACKEND=nvidia-drm
|
echo "Checking GPU availability..."
|
||||||
|
if command -v nvidia-smi &> /dev/null; then
|
||||||
|
nvidia-smi -L || echo "Warning: Could not list GPUs"
|
||||||
|
fi
|
||||||
|
|
||||||
# Verify GPU accessibility
|
echo "Starting GPU miner..."
|
||||||
echo "Checking GPU availability..."
|
echo "Python version: $(venv/bin/python --version)"
|
||||||
if command -v nvidia-smi &> /dev/null; then
|
echo "Compile-time GCC: ${gccCompiler}/bin/gcc ($(${gccCompiler}/bin/gcc --version | head -n1))"
|
||||||
nvidia-smi -L || echo "Warning: Could not list GPUs"
|
echo "Runtime GCC library: ${gccRuntime.cc.lib}/lib"
|
||||||
fi
|
echo "Working directory: $(pwd)"
|
||||||
|
echo "NVCC wrapper: $(type -p nvcc)"
|
||||||
|
|
||||||
echo "Starting GPU miner..."
|
# Verify the critical library is available
|
||||||
echo "Python version: $(venv/bin/python --version)"
|
echo "Checking for CXXABI_1.3.15..."
|
||||||
echo "Compile-time GCC: ${gccCompiler}/bin/gcc ($(${gccCompiler}/bin/gcc --version | head -n1))"
|
if strings ${gccRuntime.cc.lib}/lib/libstdc++.so.6 | grep -q CXXABI_1.3.15; then
|
||||||
echo "Runtime GCC library: ${gccRuntime.cc.lib}/lib"
|
echo "✓ CXXABI_1.3.15 found in runtime libstdc++"
|
||||||
echo "Working directory: $(pwd)"
|
else
|
||||||
|
echo "✗ WARNING: CXXABI_1.3.15 not found"
|
||||||
|
fi
|
||||||
|
|
||||||
# Verify the critical library is available
|
# Test nvcc compilation
|
||||||
echo "Checking for CXXABI_1.3.15..."
|
echo "Testing nvcc compiler configuration..."
|
||||||
if strings ${gccRuntime.cc.lib}/lib/libstdc++.so.6 | grep -q CXXABI_1.3.15; then
|
/tmp/nvcc-wrapper/nvcc --version
|
||||||
echo "✓ CXXABI_1.3.15 found in runtime libstdc++"
|
|
||||||
else
|
|
||||||
echo "✗ WARNING: CXXABI_1.3.15 not found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run the miner
|
# Run the miner
|
||||||
exec venv/bin/python main.py --workers ${builtins.toString cfg.maxWorkers} 2>&1
|
exec venv/bin/python main.py --workers ${builtins.toString cfg.maxWorkers} 2>&1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue