# InteractiveUtils is not aware of CuDevice type

**URL:** <https://discourse.julialang.org/t/interactiveutils-is-not-aware-of-cudevice-type/39358>\
**Category:** GPU\
**Created:** [May 12, 2020, 6:00pm UTC](https://discourse.julialang.org/t/interactiveutils-is-not-aware-of-cudevice-type/39358 "2020-05-12T18:00:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bocc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bocc/32/7546_2.png) [@bocc](https://discourse.julialang.org/u/bocc)\
**Post date:** [May 12, 2020, 6:00pm UTC](https://discourse.julialang.org/t/interactiveutils-is-not-aware-of-cudevice-type/39358/1 "2020-05-12T18:00:26Z")

</div>

Hello there,

it seems that the info methods provided by InteractiveUtils do not work with the `CuDevice` type. For example, in the following code

```julia
using CUDAdrv

dev = first(devices())

methodswith(dev)

methods(capability)

```

`methodswith` reports `no matching method`, while `methods(capability)` properly reports `capability(dev::CuDevice) in CUDAdrv ...`. The same goes for `supertype` and `subtypes`. CuDevice is exported from CUDAdrv.

I know this is not a big deal, but I maybe it’s worth a mention.

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [May 13, 2020, 12:36pm UTC](https://discourse.julialang.org/t/interactiveutils-is-not-aware-of-cudevice-type/39358/2 "2020-05-13T12:36:13Z")

</div>

You need to use the type with `methodswith`:

```julia
julia> using CUDAdrv

julia> dev = first(devices())
CuDevice(0): Quadro RTX 5000

julia> methodswith(typeof(dev))
[1] ==(a::CuDevice, b::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:31
[2] convert(::Type{Int32}, dev::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:29
[3] hash(dev::CuDevice, h::UInt64) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:32
[4] show(io::IO, ::MIME{Symbol("text/plain")}, dev::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:35
[5] attribute(dev::CuDevice, code::CUDAdrv.CUdevice_attribute_enum) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:76
[6] capability(dev::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:129
[7] name(dev::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:51
[8] totalmem(dev::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:64
[9] warpsize(dev::CuDevice) in CUDAdrv at /home/tim/Julia/pkg/CUDAdrv/src/devices.jl:121

```

---

<div class="post-metadata">

**Author:** ![bocc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bocc/32/7546_2.png) [@bocc](https://discourse.julialang.org/u/bocc)\
**Post date:** [May 13, 2020, 7:11pm UTC](https://discourse.julialang.org/t/interactiveutils-is-not-aware-of-cudevice-type/39358/3 "2020-05-13T19:11:20Z")

</div>

Well that’s embarrassing 🙂 Thanks!
