build on rockm
This commit is contained in:
49
rin/miner/rocm-direct-output/integration/README.md
Normal file
49
rin/miner/rocm-direct-output/integration/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# RinHash ROCm GPU Direct Integration
|
||||
|
||||
This build uses the existing `cpuminer-rocm-build` container to avoid dependency issues.
|
||||
|
||||
## Files Created
|
||||
|
||||
### GPU Libraries (`gpu-libs/`)
|
||||
- `librinhash_hip.so` - Shared library for GPU acceleration
|
||||
- `*.cuh` - Header files for GPU functions
|
||||
|
||||
## Usage
|
||||
|
||||
### 1. Copy GPU library to system
|
||||
```bash
|
||||
sudo cp gpu-libs/librinhash_hip.so /usr/local/lib/
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
### 2. For cpuminer integration
|
||||
Modify your cpuminer RinHash implementation to use GPU functions:
|
||||
|
||||
```c
|
||||
#include <dlfcn.h>
|
||||
|
||||
// Load GPU library
|
||||
void* gpu_lib = dlopen("librinhash_hip.so", RTLD_LAZY);
|
||||
if (gpu_lib) {
|
||||
// Use GPU functions
|
||||
rinhash_cuda_function = dlsym(gpu_lib, "rinhash_cuda");
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Build cpuminer with GPU support
|
||||
```bash
|
||||
./configure CFLAGS="-O3 -march=native"
|
||||
make -j$(nproc)
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Test GPU support:
|
||||
```bash
|
||||
rocm-smi # Check GPU availability
|
||||
```
|
||||
|
||||
Test library loading:
|
||||
```bash
|
||||
ldd librinhash_hip.so
|
||||
```
|
36
rin/miner/rocm-direct-output/integration/test-gpu.sh
Normal file
36
rin/miner/rocm-direct-output/integration/test-gpu.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
echo "Testing RinHash ROCm GPU Direct Build..."
|
||||
|
||||
echo "1. Testing GPU library:"
|
||||
if [ -f "../gpu-libs/librinhash_hip.so" ]; then
|
||||
echo "✓ GPU library found"
|
||||
file ../gpu-libs/librinhash_hip.so
|
||||
echo "Library size:"
|
||||
du -h ../gpu-libs/librinhash_hip.so
|
||||
echo "Library dependencies:"
|
||||
ldd ../gpu-libs/librinhash_hip.so 2>/dev/null || echo "Could not check dependencies"
|
||||
else
|
||||
echo "✗ GPU library not found"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "2. Testing ROCm environment:"
|
||||
if command -v rocm-smi &> /dev/null; then
|
||||
echo "✓ ROCm runtime available"
|
||||
rocm-smi --showid
|
||||
rocm-smi --showmeminfo vram 2>/dev/null || echo "Could not get memory info"
|
||||
else
|
||||
echo "✗ ROCm runtime not available"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "3. Testing GPU compilation:"
|
||||
if command -v hipcc &> /dev/null; then
|
||||
echo "✓ HIP compiler available"
|
||||
hipcc --version | head -3
|
||||
else
|
||||
echo "✗ HIP compiler not available"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "GPU test completed!"
|
Reference in New Issue
Block a user