Skip to content

Conversation

@syl20bnr
Copy link
Member

No description provided.

@jpteb
Copy link

jpteb commented Oct 15, 2025

@jpteb @Redhawk18 can you test this fix: #25

I have written basically the same code yesterday and it did compile!

But I could not run all tests successfully.
test_launch_kernel_end_to_end failed with I think a not fully initialized ROCm runtime during compilation, with a status code of 6 at the L94-97 assert. Unfortunately I didn't find the time to investigate that issue further. Now I'm not sure if that is a seperate issue, or related to this.

@syl20bnr
Copy link
Member Author

syl20bnr commented Oct 15, 2025

OK,great that the compilation pass works. The status code 6 means:

pub const hiprtcResult_HIPRTC_ERROR_COMPILATION: hiprtcResult = 6;

Which is not really useful lol

Do you have more info from the output ? We try to output the compilation log if the compilation of the kernel failed.

@syl20bnr
Copy link
Member Author

Test with cargo test -- --nocapture to see the logs.

@jpteb
Copy link

jpteb commented Oct 15, 2025

Here is the error log:

Error log
Ψ ❱ cargo t -- --nocapture
    Finished `test` profile [unoptimized] target(s) in 0.04s
     Running unittests src/lib.rs (target/x86_64-unknown-linux-gnu/debug/deps/cubecl_hip_sys-0f06c84080b2f62f)

running 11 tests
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_5_no_features_section ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_3_with_comments ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_3_leading_zeros ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_4_no_hip_features ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_1_standard ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_2_with_rc_suffix ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_2_unordered ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_1_standard ... ok

thread 'hipconfig::tests::test_parse_hip_patch_number::case_4_missing_hyphen' panicked at crates/cubecl-hip-sys/src/hipconfig.rs:101:5:
Error retrieving HIP patch number from value '6.4.43482'
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'hipconfig::tests::test_parse_hip_patch_number::case_5_completely_invalid' panicked at crates/cubecl-hip-sys/src/hipconfig.rs:101:5:
Error retrieving HIP patch number from value 'no numbers'
test hipconfig::tests::test_parse_hip_patch_number::case_4_missing_hyphen ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_5_completely_invalid ... ok
Free: 16921919488 | Total:17163091968
Compilation log size: 98
Compilation log: hip runtime failed to load.
Error: Please provide architecture for which code is to be generated.


thread 'tests::test_launch_kernel_end_to_end' panicked at crates/cubecl-hip-sys/src/lib.rs:101:13:
assertion `left == right` failed: Should compile the program
  left: 6
 right: 0
test tests::test_launch_kernel_end_to_end ... FAILED

failures:

failures:
    tests::test_launch_kernel_end_to_end

test result: FAILED. 10 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass `-p cubecl-hip-sys --lib`

I tried to google the phrase Please provide architecture for which code is to be generated. yesterday, but didn't find anything (I didn't spend too much time on it though).

@Redhawk18
Copy link

for note, I have a 7900xtx (RDNA3)

redhawk in 🌐 Mythra in cubecl-hip-sys-7/crates/cubecl-hip-sys on  fix/nixos is 📦 v7.0.5183100 via C v14.3.0-gcc via 🦀 v1.89.0 via ❄  impure (devenv-shell-env) 
❯ cargo build
   Compiling libc v0.2.172
   Compiling cubecl-hip-sys v7.0.5183100 (/home/redhawk/code/burn/cubecl-hip-sys-7/crates/cubecl-hip-sys)
    Finished `dev` profile [unoptimized] target(s) in 2.46s

redhawk in 🌐 Mythra in cubecl-hip-sys-7/crates/cubecl-hip-sys on  fix/nixos is 📦 v7.0.5183100 via C v14.3.0-gcc via 🦀 v1.89.0 via ❄  impure (devenv-shell-env) took 2s 
❯ cargo test
   Compiling cubecl-hip-sys v7.0.5183100 (/home/redhawk/code/burn/cubecl-hip-sys-7/crates/cubecl-hip-sys)
    Finished `test` profile [unoptimized] target(s) in 2.28s
     Running unittests src/lib.rs (/home/redhawk/code/burn/cubecl-hip-sys-7/target/debug/deps/cubecl_hip_sys-a83f490c3da70082)

running 11 tests
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_5_no_features_section ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_1_standard ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_3_with_comments ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_5_completely_invalid ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_2_unordered ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_4_missing_hyphen ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_2_with_rc_suffix ... ok
test hipconfig::tests::test_extract_latest_hip_feature_from_path::case_4_no_hip_features ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_3_leading_zeros ... ok
test hipconfig::tests::test_parse_hip_patch_number::case_1_standard ... ok
test tests::test_launch_kernel_end_to_end ... ok

test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.63s

   Doc-tests cubecl_hip_sys

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

I wanted to do a true test with burn bench, but we'll have to update that before. Looks good

@jpteb
Copy link

jpteb commented Oct 15, 2025

@Redhawk18 interesting. What packages do you have in your shell? Maybe I'm missing something

@jpteb
Copy link

jpteb commented Oct 15, 2025

Ehh, I guess I didn't set my LD_LIBRARY_PATH correctly. Now it works for me too

@Redhawk18
Copy link

Redhawk18 commented Oct 15, 2025

@Redhawk18 interesting. What packages do you have in your shell? Maybe I'm missing something
hardware config.nix

You might not need all of it

  nixpkgs = {
    config.rocmSupport = true;
    localSystem = {
      system = "x86_64-linux";
    };

    system = lib.mkDefault "x86_64-linux";
  };

  hardware = {
    amdgpu.opencl.enable = true;

    graphics.extraPackages = with pkgs; [
      rocmPackages.clr.icd
      rocmPackages.hip-common
      rocmPackages.rocm-runtime
    ];

    opengl = {
      enable = true;
      # driSupport = true;
      driSupport32Bit = true;
    };

  };

  services.xserver.videoDrivers = [ "amdgpu" ];

  environment.systemPackages = with pkgs; [
    corectrl
    kdePackages.partitionmanager

    clinfo
    nvtopPackages.amd

    rocmPackages.rocm-smi
    rocmPackages.rocminfo
    rocmPackages.clr
    rocmPackages.hipcc
  ];

  systemd.tmpfiles.rules = [
    "L+ /opt/rocm - - - - ${pkgs.rocmPackages.rocm-runtime}" # Might not be needed.
  ];

@syl20bnr
Copy link
Member Author

Awesome, going to release a patch with this. Thank you for your patience and investigation 😄

@syl20bnr syl20bnr merged commit 6f24319 into main Oct 15, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

4 participants