Skip to content

Commit

Permalink
fix: return launch kernel error
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin committed Jun 24, 2024
1 parent 78b4fd3 commit 7bce23b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/resourceprovider/cudaworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package resourceprovider
import (
"context"
_ "embed"
"fmt"
"math/big"
"os"
"slices"
Expand Down Expand Up @@ -222,6 +223,9 @@ func kernel_lilypad_pow_with_ctx(cuCtx *cu.Ctx, fn cu.Function, challenge [32]by
cuCtx.MemcpyHtoD(dIn3, unsafe.Pointer(&difficutyBytes[0]), 32)

cuCtx.LaunchKernel(fn, grid, 1, 1, block, 1, 1, 1, cu.Stream{}, args)
if err = cuCtx.Error(); err != nil {
return nil, fmt.Errorf("launch kernel fail maybe decrease threads help %w", err)
}
cuCtx.Synchronize()

hOut := make([]byte, 32)
Expand Down

0 comments on commit 7bce23b

Please sign in to comment.