CUDA.device() info is displayed, but neither printed nor stored on variable

The below command in my Julia 1.6.7 / CUDA v3.12.0 system:


has the answer:

CuDevice(0): NVIDIA GeForce RTX 2060

However, when printing or storing the output on a variable,

println( CUDA.device() )
x = CUDA.device()

the displayed answer is just:


Would appreciate any support, as to obtain full answer. Thanks.

The REPL prints things differently, the same applies to e.g. array objects. You can use the display function if you want REPL-style output from a script.

For printing, OK. For storing the info on a variable, or on a data frame (which is the actual application), the variable apparently retains only the short form. Thus, we loose the information.

Is there a way to get GPU info from within Julia, without loosing such info?


That seems like a weird thing to do. Why don’t you query the name directly ( instead of relying on the I/O routines?

That works, thanks.