I have fixed it here: https://launchpad.net/~bullwinkle-
team/+archive/ubuntu/rocm-devel-21/+build/32717260

logs from gfx1151:
```
root@resolute-igor:/home/ubuntu# cat > main.cpp << 'EOF'
#include <stdio.h>
#include <stdlib.h>
#include <hip/hip_runtime.h>

#define CHECK_HIP(expr) do { \
  hipError_t result = (expr); \
  if (result != hipSuccess) { \
    fprintf(stderr, "%s:%d: %s (%d)\n", \
      FILE, LINE, \
      hipGetErrorString(result), result); \
    exit(EXIT_FAILURE); \
  } \
} while(0)

global void sq_arr(float arr, int n) {
  int tid = blockDim.xblockIdx.x + threadIdx.x;
  if (tid < n) arr[tid] = arr[tid] * arr[tid];
}

int main() {
  enum { N = 5 };
  float hArr[N] = { 1, 2, 3, 4, 5 };
  float *dArr;
  CHECK_HIP(hipMalloc(&dArr, sizeof(float) * N));
  CHECK_HIP(hipMemcpy(dArr, hArr, sizeof(float) * N, hipMemcpyHostToDevice));
  sq_arr<<<dim3(1), dim3(32,1,1), 0, 0>>>(dArr, N);
  CHECK_HIP(hipMemcpy(hArr, dArr, sizeof(float) * N, hipMemcpyDeviceToHost));
  for (int i = 0; i < N; ++i) printf("%f\n", hArr[i]);
  CHECK_HIP(hipFree(dArr));
  return 0;
}
EOF

hipcc main.cpp -o test_hip
./test_hip 2>&1
1.000000
4.000000
9.000000
16.000000
25.000000
root@resolute-igor:/home/ubuntu# 
```

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2142805

Title:
  Failed to free ptr in hsa_shutdown

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rocr-runtime/+bug/2142805/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to