mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-24 01:29:57 +08:00
[Fix] Use paddle.device.get_device_properties for multi-platform compatibility (#6400)
Replace paddle.device.cuda.get_device_properties() with paddle.device.get_device_properties() to support all hardware platforms (NVIDIA, ILUVATAR, HPU, etc.) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,14 +21,16 @@ PACKAGE = "fastdeploy.model_executor.ops.gpu"
|
||||
|
||||
|
||||
def decide_module():
|
||||
import os
|
||||
|
||||
import paddle
|
||||
|
||||
prop = paddle.device.cuda.get_device_properties()
|
||||
# Use paddle.device.get_device_properties() instead of paddle.device.cuda.get_device_properties()
|
||||
# to support all hardware platforms (NVIDIA, ILUVATAR, HPU, etc.)
|
||||
prop = paddle.device.get_device_properties()
|
||||
sm_version = prop.major * 10 + prop.minor
|
||||
print(f"current sm_version={sm_version}")
|
||||
|
||||
import os
|
||||
|
||||
curdir = os.path.dirname(os.path.abspath(__file__))
|
||||
sm_version_path = os.path.join(curdir, f"fastdeploy_ops_{sm_version}")
|
||||
if os.path.exists(sm_version_path):
|
||||
|
||||
Reference in New Issue
Block a user