ROCm / rocALUTION

Next generation library for iterative sparse solvers for ROCm platform
https://rocm.docs.amd.com/projects/rocALUTION/en/latest/
MIT License
75 stars 39 forks source link

HIP error: invalid device function #197

Closed klausbu closed 10 months ago

klausbu commented 10 months ago

I am implementing rocalution into an application.

It works fine using the OpenMP backend but when I set the device number for the GPU using: export HIP_VISIBLE_DEVICES=0; export ROCR_VISIBLE_DEVICES=0 , I get the following HIP error message:

Number of CPU cores: 16
Host thread affinity policy - thread mapping on every core
Number of HIP devices in the system: 1
Matrix+Vectors loading:5.7e-05 sec
HIP error: invalid device function
File: /long_pathname_so_that_rpms_can_package_the_debug_info/src/extlibs/rocALUTION/src/base/hip/hip_vector.cpp; line: 845

My small helloGPU device query program works fine:

#include <hip/hip_runtime.h>
#include <cstdio>

__global__ void helloGpu(int gpuId) {
    printf("device %d Gpu thread %d\n", gpuId, (int)threadIdx.x);
}

int main(int agrc, const char * argv[]){
    int device = 0, gpuId = device;

    hipSetDevice(device);

    hipLaunchKernelGGL((helloGpu), dim3(1), dim3(64), 0, 0, gpuId);

    hipDeviceSynchronize();

    return 0;
}

What could be the problem?

EDIT: export HIP_VISIBLE_DEVICES=0; export ROCR_VISIBLE_DEVICES=0; HSA_OVERRIDE_GFX_VERSION=10.3.0

adding HSA_OVERRIDE_GFX_VERSION=10.3.0 fixes the problem.

Maybe rocalution (I am using 5.7.1 RHEL version) is not compiled to support my gfx1031 card?

ntrost57 commented 10 months ago

Yes, officially, we do not support gfx1031. You can, however, modify the CMakeLists.txt in root directory and add gfx1031 to the build targets.