Valgrind with CUDA: noted but unhandled ioctl with no size/direction hints

Jiading Guo <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <CACwB4iauqWsfwmfEstHp4gmde7n6rK69wkG+DmB4mbd7s0K3Dg@mail.gmail.com>
Hi everyone.

I'm trying Valgrind on a simple CUDA program for CPU memory check (It
worked for GPU memcheck when using cuda-memcheck):

```
#include <stdlib.h>

int main()
{
  void *dp = NULL;
  cudaMalloc(&dp, 1024);
  cudaFree(dp);

  void *p = NULL;
  p = malloc(1024);
  free(p);

  cudaDeviceReset();
  return 0;
}
```

The program hangs with many `noted but unhandled ioctl with no
size/direction hints` warnings.

```
$ nvcc prog.cu
$ valgrind ./a.out
==61517== Memcheck, a memory error detector
==61517== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==61517== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==61517== Command: ./a.out
==61517==
==61517== Warning: noted but unhandled ioctl 0x30000001 with no
size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: noted but unhandled ioctl 0x27 with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: noted but unhandled ioctl 0x7ff with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: noted but unhandled ioctl 0x25 with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: noted but unhandled ioctl 0x37 with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: noted but unhandled ioctl 0x17 with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: set address range perms: large range [0x200000000,
0x300200000) (noaccess)
==61517== Warning: set address range perms: large range [0x7798000,
0x27797000) (noaccess)
==61517== Warning: set address range perms: large range
[0x10006000000, 0x10106000000) (noaccess)
==61517== Warning: noted but unhandled ioctl 0x19 with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: set address range perms: large range
[0x10106000000, 0x10206000000) (noaccess)
==61517== Warning: noted but unhandled ioctl 0x21 with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==61517== Warning: noted but unhandled ioctl 0x1b with no size/direction hints.
==61517==    This could cause spurious value errors to appear.
==61517==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
```

I'm also follwing this question[0] to generate Valgrind suppressions,
the program hangs again with same warnings. How can I use Valgrind
with CUDA correctly? Thanks in advance.

I'm using Ubuntu 18.04 + CUDA 9.1 + Valgrind 3.13.0.

Best regards,
Jiading Guo

[0]: https://stackoverflow.com/questions/20593450/valgrind-and-cuda-are-reported-leaks-real
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.