Skip to content
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

CUDA Kernel fails at sqrt() or rsqrtf() operations #9

Open
JerryI opened this issue Dec 24, 2022 · 2 comments
Open

CUDA Kernel fails at sqrt() or rsqrtf() operations #9

JerryI opened this issue Dec 24, 2022 · 2 comments

Comments

@JerryI
Copy link

JerryI commented Dec 24, 2022

I found a strange bug. Let me consider the simplest kernel

__global__ void makezeros(
    float4* spin
) {
    int blockId = blockIdx.x + blockIdx.y * gridDim.x + gridDim.x * gridDim.y * blockIdx.z;
    int gid = blockId * (blockDim.x * blockDim.y) + (threadIdx.y * blockDim.x) + threadIdx.x;
    
    spin[gid].x = 0.001;
}

It works absolutely perfect. However, it is enough to add a square root operation

__global__ void makezeros(
    float4* spin
) {
    int blockId = blockIdx.x + blockIdx.y * gridDim.x + gridDim.x * gridDim.y * blockIdx.z;
    int gid = blockId * (blockDim.x * blockDim.y) + (threadIdx.y * blockDim.x) + threadIdx.x;
    
    float empty = sqrt(3.3f);
    spin[gid].x = 0.001;
}

and the, the array spin will not be affected. However, It doesn't show any errors.
It looks like that this kernel code was not even called.

@JerryI
Copy link
Author

JerryI commented Dec 25, 2022

Found an error code. It is

PTX JIT compilation failed
Error code 78

Every time at sqrt() function or others

@SimeonEhrig
Copy link
Collaborator

I have to verify it with the latest cling version. The container is highly outdated.

My assumption: The path to the CUDA std library is not set for the device compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants