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

Bitonic Sort example fails with GPU kernel error. #364

Open
ethanbarry opened this issue May 18, 2024 · 2 comments
Open

Bitonic Sort example fails with GPU kernel error. #364

ethanbarry opened this issue May 18, 2024 · 2 comments
Labels
bug Something isn't working HVM About the HVM

Comments

@ethanbarry
Copy link

Description

When I run the compiled CUDA bitonic sorter example (linked in the README) I get this error:

Failed to launch kernels (error code an illegal memory access was encountered)!

To Reproduce

Steps to reproduce the behavior:

  1. bend gen-cu sorter.bend > sorter.cu
  2. nvcc sorter.cu -o sorter
  3. prime-run ./sorter (Launches it on the GPU for Arch Linux.)
  4. Error recieved.

Expected behavior

The program runs on the GPU.

Desktop (please complete the following information):

  • OS: Linux (Arch 6.9.1-arch1-1)
  • CPU: Intel i7-11800H
  • GPU: RTX 3050 Ti Mobile
  • GPU Driver: Nvidia open kernel modules v550.78
  • CUDA release 12.4, V12.4.131

Additional context

The program runs using the C codegen backend, but with the CUDA backend, it seems to fail regardless of what I do. If anyone is curious about the prime-run command, it's really just a script that forces the dGPU to handle a task - nothing fancy.

@developedby
Copy link
Member

I'm moving this issue to the HVM repository HigherOrderCO/HVM#314

@2lian
Copy link

2lian commented May 22, 2024

I am re-posting my fix here

The discussion is here on the hvm github. Re-posting because, hvm V2.0.13 is required and this is not the version of the hvm github, so this fix is specific to bend. (github V2.0.14 does not work at all with my bend)

I had the same issue. I cloned, HVM changed LNet seeting according to #283 , but the current repo V2.0.14 does not work with bend, and I do not know where V2.0.13 (for bend) is.

I never used cargo so excuse me if I am doing some black magic here, but this is how I fixed it for bend:

mkdir ~/hvmtmp
cd ~/hvmtmp
cargo init
cargo add hvm@=2.0.13
cargo vendor vendor
cd vendor/hvm

You are now inside the source of hvm V2.0.13.

Open and edit src/hvm.cu. Line 334 reduce L_NODE_LEN and L_VARS_LEN, but do not reduce too much. This value works on my GTX 1080Ti:

// Local Net
const u32 L_NODE_LEN = 0x2000/4;
const u32 L_VARS_LEN = 0x2000/4;
struct LNet {
  Pair node_buf[L_NODE_LEN];
  Port vars_buf[L_VARS_LEN];
};

Now go back to hvm V2.0.13 you downloaded and install it:

cd ~/hvmtmp/vendor/hvm
cargo +nightly install --path .

This should work, you can now delete ~/hvmtmp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HVM About the HVM
Projects
None yet
Development

No branches or pull requests

3 participants