-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does gnark start GPU acceleration? #1130
Comments
Hi, indeed setting up the GPU support is a bit cumbersome and depends on the ICICLE library being set up correctly. Have a look at https://github.com/ingonyama-zk/icicle/tree/main/wrappers/golang on how to build ICICLE. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am at gnark/.../example, a main. go was created, such as the following code:
package main
import (
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
)
// CubicCircuit defines a simple circuit
// x**3 + x + 5 == y
type CubicCircuit struct {
// struct tags on a variable is optional
// default uses variable name and secret visibility.
X frontend.Variable
gnark:"x"
Y frontend.Variable
gnark:",public"
}
// Define declares the circuit constraints
// x**3 + x + 5 == y
func (circuit *CubicCircuit) Define(api frontend.API) error {
x3 := api.Mul(circuit.X, circuit.X, circuit.X)
api.AssertIsEqual(circuit.Y, api.Add(x3, circuit.X, 5))
return nil
}
func main() {
// compiles our circuit into a R1CS
var circuit CubicCircuit
ccs, _ := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
}
errors:
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lbn254: No such file or directory
collect2: error: ld returned 1 exit status
Should I download the article first and then compile it?
Finally, to gnark/.../example and to execute "go run -tags=icicle main.go"
What should I do?
The text was updated successfully, but these errors were encountered: