From d60438d543cc0bcafd8801cb5b397e4acf7b6aa9 Mon Sep 17 00:00:00 2001 From: hunjixin <1084400399@qq.com> Date: Mon, 24 Jun 2024 04:19:25 +0000 Subject: [PATCH] fix: return launch kernel error --- pkg/resourceprovider/cudaworker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/resourceprovider/cudaworker.go b/pkg/resourceprovider/cudaworker.go index 7757f52f..84b9cdc0 100644 --- a/pkg/resourceprovider/cudaworker.go +++ b/pkg/resourceprovider/cudaworker.go @@ -6,6 +6,7 @@ package resourceprovider import ( "context" _ "embed" + "fmt" "math/big" "os" "slices" @@ -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)