Skip to content

Seeming unnecessary CGO depdenency in nvmlreceiver #180

@Dylan-M

Description

@Dylan-M

Currently, the nvmlreceiver is using a single dependency on a C library here:
https://github.com/GoogleCloudPlatform/opentelemetry-operations-collector/blob/master/receiver/nvmlreceiver/testcudakernel/test_cuda_kernel.cc

Based on my review of, but with limited understanding of the Nvidia libraries in general, this could be replaced with a native golang library.

From: https://docs.nvidia.com/cuda/cublas/index.html#id92

cublasStatus_t cublasXtDgemm(cublasXtHandle_t handle,
                           cublasOperation_t transa, cublasOperation_t transb,
                           int m, int n, int k,
                           const double          *alpha,
                           const double          *A, int lda,
                           const double          *B, int ldb,
                           const double          *beta,
                           double          *C, int ldc)

From: https://pkg.go.dev/gorgonia.org/cu/blas#Standard.Dgemm

func (impl *Standard) Dgemm(tA, tB blas.Transpose, m, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int)

These function definitions seem to be identical, with the exception of the cublasXtHandle. That handle wouldn't be needed in the pure golang implementation; so it makes sense for it to be missing.

If I am correct, this would be a nice change. Anything that can strip a collector down to a pure golang implementation is good in my book.

If I am incorrect in my belief that these libraries are functionally the same, I'm happy to be corrected on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions