NVIDIA / NVIDIA/raft

[BUG]Error in compiling with GCC11

Open
#445 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Cuda
Stars
1k
Forks
251
Avg merge
1d 8h
Merged PRs (30d)
31

Description

I tried comping raft on branch-22.02 with GCC11, but it ended in fail I think the following patch is needed to make it build-able.

In cub_wrappers.cuh, it is necessary to set the initial value to worksize.
In sort.cu, for pointers, if you release them with "delete", you should allocate them with "new".

`

*** raft/cpp/include/raft/common/cub_wrappers.cuh-dist  2022-01-14 15:37:43.356426295 +0900
--- raft/cpp/include/raft/common/cub_wrappers.cuh       2022-01-14 15:41:27.639861604 +0900
***************
*** 44,53 ****
  {
!   size_t worksize;
    cub::DeviceRadixSort::SortPairs(
      nullptr, worksize, inKeys, outKeys, inVals, outVals, len, 0, sizeof(KeyT) * 8, stream);
    workspace.resize(worksize, stream);
    cub::DeviceRadixSort::SortPairs(
      workspace.data(), worksize, inKeys, outKeys, inVals, outVals, len, 0, sizeof(KeyT) * 8, stream);
  }
  
  }  // namespace raft
--- 44,53 ----
  {
!   size_t worksize = 0;
    cub::DeviceRadixSort::SortPairs(
      nullptr, worksize, inKeys, outKeys, inVals, outVals, len, 0, sizeof(KeyT) * 8, stream);
    workspace.resize(worksize, stream);
    cub::DeviceRadixSort::SortPairs(
      workspace.data(), worksize, inKeys, outKeys, inVals, outVals, len, 0, sizeof(KeyT) * 8, stream);
  }
  
  }  // namespace raft
*** raft/cpp/test/sparse/sort.cu-dist   2022-01-15 19:37:06.839494720 +0900
--- raft/cpp/test/sparse/sort.cu        2022-01-15 19:39:49.878890059 +0900
***************
*** 60,68 ****
  
    r.uniform(in_vals.data(), params.nnz, float(-1.0), float(1.0), stream);
  
!   int* in_rows_h = (int*)malloc(params.nnz * sizeof(int));
!   int* in_cols_h = (int*)malloc(params.nnz * sizeof(int));
!   int* verify_h  = (int*)malloc(params.nnz * sizeof(int));
  
    for (int i = 0; i < params.nnz; i++) {
      in_rows_h[i] = params.nnz - i - 1;
--- 60,68 ----
  
    r.uniform(in_vals.data(), params.nnz, float(-1.0), float(1.0), stream);
  
!   int* in_rows_h = new int[params.nnz];
!   int* in_cols_h = new int[params.nnz];
!   int* verify_h  = new int[params.nnz];
  
    for (int i = 0; i < params.nnz; i++) {
      in_rows_h[i] = params.nnz - i - 1;

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the GCC 11 build failure described for branch-22.02, then inspect raft/cpp/include/raft/common/cub_wrappers.cuh and raft/cpp/test/sparse/sort.cu. Confirm the reported initialization and allocation changes resolve compilation, and verify the affected sparse sort test builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.