You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "dk-blackfuel (via GitHub)" <gi...@apache.org> on 2025/09/23 18:57:48 UTC

[I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

dk-blackfuel opened a new issue, #11701:
URL: https://github.com/apache/cloudstack/issues/11701

   ### problem
   
   on a server with 8 AMD Mi325, the discovery script doesn't report any GPU :
   
   ```
   root@gpu-31:/home/amd/Workarea/cloudstack-test# ./gpudiscovery.sh
   { "gpus": [
   
   ]}
   ```
   
   when lspci -nnm gives :
   ```
   root@gpu-31:/home/amd/Workarea/cloudstack-test# lspci -nnm | grep AMD | grep -i Acc
   05:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   15:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   65:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   75:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   85:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   95:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   e5:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]"
   f5:00.0 "Processing accelerators [1200]" "Advanced Micro Devices, Inc. [AMD/ATI] [1002]" "Aqua Vanjaram [Instinct MI325X] [74a5]" -rff -pff "" ""
   ```
   
   The expected output would be :
   ```
   { "gpus": [
       {
         "pci_address":"05:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:05:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0x05",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"15:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:15:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0x15",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"65:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:65:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0x65",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"75:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:75:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0x75",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"85:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:85:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0x85",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"95:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:95:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0x95",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"e5:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:e5:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0xe5",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   ,
       {
         "pci_address":"f5:00.0",
         "vendor_id":"1002",
         "device_id":"74a5",
         "vendor":"Advanced Micro Devices, Inc. [AMD/ATI]",
         "device":"Aqua Vanjaram [Instinct MI325X]",
         "driver":"amdgpu",
         "pci_class":"Processing accelerators [1200]",
         "iommu_group":"null",
         "pci_root":"0000:f5:00.0",
         "numa_node":-1,
         "sriov_totalvfs":0,
         "sriov_numvfs":0,
         "max_instances":null,
         "video_ram":null,
         "max_heads":null,
         "max_resolution_x":null,
         "max_resolution_y":null,
   
         "full_passthrough": {
           "enabled":1,
           "libvirt_address": {
             "domain":"0x0000",
             "bus":"0xf5",
             "slot":"0x00",
             "function":"0x0"
           },
           "used_by_vm":null
         },
   
         "vgpu_instances":[],
         "vf_instances":[]
       }
   
   ]}
   ```
   
   ### versions
   
   GPU : AMD Mi 325X
   Cloudstack : 4.21
   
   ### The steps to reproduce the bug
   
   1. SSH to a server with MI3xx GPUs on it
   2. run the gpudiscovery.sh script on it
   
   ### What to do about it?
   
   Patch incoming 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #11701:
URL: https://github.com/apache/cloudstack/issues/11701#issuecomment-3325189329

   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on issue #11701:
URL: https://github.com/apache/cloudstack/issues/11701#issuecomment-3327584299

   @dk-blackfuel Glat to hear that. 
   When you say the VM didn't get a GPU attached, you mean on libvirt definition itself or inside the VM?
   Can you do a virsh dumpxml for the VM on the host and see if it's defined in the spec?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 closed issue #11701: GPU Discovery not detecting AMD Mi3xx GPUs
URL: https://github.com/apache/cloudstack/issues/11701


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on issue #11701:
URL: https://github.com/apache/cloudstack/issues/11701#issuecomment-3352037665

   Fixed with https://github.com/apache/cloudstack/pull/11715


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

Posted by "dk-blackfuel (via GitHub)" <gi...@apache.org>.
dk-blackfuel commented on issue #11701:
URL: https://github.com/apache/cloudstack/issues/11701#issuecomment-3327482418

   @vishesh92 That's exactly the patch that I was preparing to submit, after having successfully validating it on our host. I can confirm that it worked as intended and the devices showed up in the "GPU Devices" section of the Host. My first VM that I launched with a GPU, didn't get a GPU attached but I am debugging that part.
   
   We have access to AMD-based servers so we'll be happy to help with QA/Validation in this area. 
   
   I am gonna submit the patch today so we can get familiar with the contribution process, this won't be the last occurence imho :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] GPU Discovery not detecting AMD Mi3xx GPUs [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on issue #11701:
URL: https://github.com/apache/cloudstack/issues/11701#issuecomment-3327399783

   @dk-blackfuel we weren't able to test with AMD GPUs due to lack of hardware. But CloudStack integration should allow full passthrough of PCI devices.
   
   Looks like the PCI Class for the AMD GPUs is `Processing accelerators`. You can update the `/usr/share/cloudstack-common/scripts/vm/kvm/gpudiscovery.sh` on KVM hosts and update it to include `Processing accelerators`. 
   
   https://github.com/apache/cloudstack/blob/f9513b47bf8cda46c2cee7e31d4d662346bc7399/scripts/vm/hypervisor/kvm/gpudiscovery.sh#L719-L721
   
   So the above piece code on the KVM hosts will become 
   ```bash
   	if [[ ! "$PCI_CLASS" =~ (3D\ controller|Processing\ accelerators) ]]; then
   		continue
   	fi
   ```
   
   You will need to update this on all hosts where you have the AMD GPUs. Let me know how it goes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org