Pytorch rocm 1.81 installed but no cuda devices are available

username: suha
cooked: <p>Hi PyTorch community,</p>
<p>I have been encountering difficulty trying to use PyTorch with ROCm 4.0 when venturing to using cuda instead of the cpu as a device. ROCm and OpenCL have been installed with both rocminfo and clinfo detecting the integrated graphics card. The output is included below. Also hipcc is installed and I just can’t seem to find the problem. Thank you in advance.</p>
<p>rocminfo output:</p>
<h1>ROCk module is loaded<br>
Able to open /dev/kfd read-write</h1>
<h1>HSA System Attributes</h1>
<p>Runtime Version:         1.1<br>
System Timestamp Freq.:  1000.000000MHz<br>
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)<br>
Machine Model:           LARGE<br>
System Endianness:       LITTLE</p>
<h1>==========<br>
HSA Agents</h1>
<hr>
<p>Agent 1</p>
<hr>
<p>Name:                    AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G<br>
Uuid:                    CPU-XX<br>
Marketing Name:          AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G<br>
Vendor Name:             CPU<br>
Feature:                 None specified<br>
Profile:                 FULL_PROFILE<br>
Float Round Mode:        NEAR<br>
Max Queue Number:        0(0x0)<br>
Queue Min Size:          0(0x0)<br>
Queue Max Size:          0(0x0)<br>
Queue Type:              MULTI<br>
Node:                    0<br>
Device Type:             CPU<br>
Cache Info:<br>
L1:                      32(0x20) KB<br>
L2:                      1024(0x400) KB<br>
Chip ID:                 0(0x0)<br>
Cacheline Size:          64(0x40)<br>
Max Clock Freq. (MHz):   2600<br>
BDFID:                   0<br>
Internal Node ID:        0<br>
Compute Unit:            2<br>
SIMDs per CU:            4<br>
Shader Engines:          1<br>
Shader Arrs. per Eng.:   0<br>
WatchPts on Addr. Ranges:1<br>
Features:                None<br>
Pool Info:<br>
Pool 1<br>
Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED<br>
Size:                    0(0x0) KB<br>
Allocatable:             TRUE<br>
Alloc Granule:           4KB<br>
Alloc Alignment:         4KB<br>
Accessible by all:       TRUE<br>
Pool 2<br>
Segment:                 GLOBAL; FLAGS: COARSE GRAINED<br>
Size:                    0(0x0) KB<br>
Allocatable:             TRUE<br>
Alloc Granule:           4KB<br>
Alloc Alignment:         4KB<br>
Accessible by all:       TRUE<br>
ISA Info:<br>
N/A<br>
*** Done ***</p>
<p>clinfo output:</p>
<p>Number of platforms:				 1<br>
Platform Profile:				 FULL_PROFILE<br>
Platform Version:				 OpenCL 2.1 AMD-APP (3110.6)<br>
Platform Name:				 AMD Accelerated Parallel Processing<br>
Platform Vendor:				 Advanced Micro Devices, Inc.<br>
Platform Extensions:				 cl_khr_icd cl_amd_event_callback cl_amd_offline_devices</p>
<p>Platform Name:				 AMD Accelerated Parallel Processing<br>
Number of devices:				 1<br>
Device Type:					 CL_DEVICE_TYPE_GPU<br>
Vendor ID:					 1002h<br>
Board name:					 AMD Radeon Graphics<br>
Device Topology:				 PCI[ B#0, D#1, F#0 ]<br>
Max compute units:				 3<br>
Max work items dimensions:			 3<br>
Max work items[0]:				 1024<br>
Max work items[1]:				 1024<br>
Max work items[2]:				 1024<br>
Max work group size:				 256<br>
Preferred vector width char:			 4<br>
Preferred vector width short:			 2<br>
Preferred vector width int:			 1<br>
Preferred vector width long:			 1<br>
Preferred vector width float:			 1<br>
Preferred vector width double:		 1<br>
Native vector width char:			 4<br>
Native vector width short:			 2<br>
Native vector width int:			 1<br>
Native vector width long:			 1<br>
Native vector width float:			 1<br>
Native vector width double:			 1<br>
Max clock frequency:				 685Mhz<br>
Address bits:					 64<br>
Max memory allocation:			 1697015398<br>
Image support:				 Yes<br>
Max number of images read arguments:		 128<br>
Max number of images write arguments:		 8<br>
Max image 2D width:				 16384<br>
Max image 2D height:				 16384<br>
Max image 3D width:				 2048<br>
Max image 3D height:				 2048<br>
Max image 3D depth:				 2048<br>
Max samplers within kernel:			 16<br>
Max size of kernel argument:			 1024<br>
Alignment (bits) of base address:		 2048<br>
Minimum alignment (bytes) for any datatype:	 128<br>
Single precision floating point capability<br>
Denorms:					 No<br>
Quiet NaNs:					 Yes<br>
Round to nearest even:			 Yes<br>
Round to zero:				 Yes<br>
Round to +ve and infinity:			 Yes<br>
IEEE754-2008 fused multiply-add:		 Yes<br>
Cache type:					 Read/Write<br>
Cache line size:				 64<br>
Cache size:					 16384<br>
Global memory size:				 2000715776<br>
Constant buffer size:				 1697015398<br>
Max number of constant args:			 8<br>
Local memory type:				 Scratchpad<br>
Local memory size:				 32768<br>
Max pipe arguments:				 0<br>
Max pipe active reservations:			 0<br>
Max pipe packet size:				 0<br>
Max global variable size:			 0<br>
Max global variable preferred total size:	 0<br>
Max read/write image args:			 0<br>
Max on device events:				 0<br>
Queue on device max size:			 0<br>
Max on device queues:				 0<br>
Queue on device preferred size:		 0<br>
SVM capabilities:				<br>
Coarse grain buffer:			 No<br>
Fine grain buffer:				 No<br>
Fine grain system:				 No<br>
Atomics:					 No<br>
Preferred platform atomic alignment:		 0<br>
Preferred global atomic alignment:		 0<br>
Preferred local atomic alignment:		 0<br>
Kernel Preferred work group size multiple:	 64<br>
Error correction support:			 0<br>
Unified memory for Host and Device:		 1<br>
Profiling timer resolution:			 1<br>
Device endianess:				 Little<br>
Available:					 Yes<br>
Compiler available:				 Yes<br>
Execution capabilities:				<br>
Execute OpenCL kernels:			 Yes<br>
Execute native function:			 No<br>
Queue on Host properties:				<br>
Out-of-Order:				 No<br>
Profiling :					 Yes<br>
Queue on Device properties:				<br>
Out-of-Order:				 No<br>
Profiling :					 No<br>
Platform ID:					 0x7fb2e31dde50<br>
Name:						 Stoney<br>
Vendor:					 Advanced Micro Devices, Inc.<br>
Device OpenCL C version:			 OpenCL C 1.2<br>
Driver version:				 3110.6<br>
Profile:					 FULL_PROFILE<br>
Version:					 OpenCL 1.2 AMD-APP (3110.6)<br>
Extensions:					 cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_image2d_from_buffer cl_khr_spir cl_khr_gl_event</p>

username: suha
cooked: <p>So I just noticed device type says cpu on rocminfo so I’m going to remove and reinstall rocm</p>

username: Horst_G
cooked: <aside class="quote no-group" data-username="suha" data-post="2" data-topic="116608">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/suha/48/29848_2.png" class="avatar"> suha:</div>
<blockquote>
<p>rocminfo</p>
</blockquote>
</aside>
<p>Hey I am also installed the ROCm 4.0. Isn’t it enough to enter the commands using pip as pytorch says? Do I have to install multiple packages manually? How do you actually access your gpu via pytorch (since tensorX.cuda() or torch.device(“cuda”) does not work?</p>