Skip to content

Commit

Permalink
gpu/cuda: fix build with external GDRCopy
Browse files Browse the repository at this point in the history
If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1.
This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv.
stdlib.h is included for the definition of getenv function.

Bugzilla ID: 1133
Fixes: ca12f5e ("gpu/cuda: mark unused GDRCopy functions parameters")
Cc: [email protected]

Reported-by: John Romein <[email protected]>
Signed-off-by: Levend Sayar <[email protected]>
Acked-by: Elena Agostini <[email protected]>
  • Loading branch information
sayarsoft authored and david-marchand committed Oct 6, 2023
1 parent a52d472 commit cda3d17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ John McNamara <[email protected]>
John Miller <[email protected]>
John OLoughlin <[email protected]>
John Ousterhout <[email protected]>
John Romein <[email protected]>
John W. Linville <[email protected]>
Jonas Pfefferle <[email protected]> <[email protected]>
Jonathan Erb <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/cuda/gdrcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#ifdef DRIVERS_GPU_CUDA_GDRCOPY_H

#include <stdlib.h>

static void *gdrclib;
static gdr_t (*sym_gdr_open)(void);
static int (*sym_gdr_pin_buffer)(gdr_t g, unsigned long addr, size_t size,
Expand Down

0 comments on commit cda3d17

Please sign in to comment.