bittensor.utils._register_cuda

bittensor.utils._register_cuda#

Functions#

solve_cuda(nonce_start, update_interval, tpb, ...[, ...])

Solves the PoW problem using CUDA.

reset_cuda()

Resets the CUDA environment.

log_cuda_errors()

Logs any CUDA errors.

Module Contents#

bittensor.utils._register_cuda.solve_cuda(nonce_start, update_interval, tpb, block_and_hotkey_hash_bytes, difficulty, limit, dev_id=0)[source]#

Solves the PoW problem using CUDA. :param nonce_start: int64

Starting nonce.

Parameters:
  • update_interval (numpy.int64) – int64 Number of nonces to solve before updating block information.

  • tpb (int) – int Threads per block.

  • block_and_hotkey_hash_bytes (bytes) – bytes Keccak(Bytes of the block hash + bytes of the hotkey) 64 bytes.

  • difficulty (int) – int256 Difficulty of the PoW problem.

  • limit (int) – int256 Upper limit of the nonce.

  • dev_id (int) – int (default=0) The CUDA device ID

  • nonce_start (numpy.int64)

Returns:

Tuple[int64, bytes]

Tuple of the nonce and the seal corresponding to the solution. Returns -1 for nonce if no solution is found.

Return type:

Tuple[numpy.int64, bytes]

bittensor.utils._register_cuda.reset_cuda()[source]#

Resets the CUDA environment.

bittensor.utils._register_cuda.log_cuda_errors()[source]#

Logs any CUDA errors.

Return type:

str