Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

旧显卡如M40出现"RuntimeError: CUDA error: CUBLAS_STATUS_NOT_SUPPORTED" #1508

Closed
steventsang7 opened this issue Jan 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@steventsang7
Copy link

Description of the bug | 错误描述

RuntimeError: CUDA error: CUBLAS_STATUS_NOT_SUPPORTED when calling cublasGemmStridedBatchedEx(handle, opa, opb, (int)m, (int)n, (int)k, (void*)&falpha, a, CUDA_R_16BF, (int)lda, stridea, b, CUDA_R_16BF, (int)ldb, strideb, (void*)&fbeta, c, CUDA_R_16BF, (int)ldc, stridec, (int)num_batches, compute_type, CUBLAS_GEMM_DEFAULT_TENSOR_OP)

How to reproduce the bug | 如何复现

运行使用过程(cuda)中出现错误:
RuntimeError: CUDA error: CUBLAS_STATUS_NOT_SUPPORTED when calling cublasGemmStridedBatchedEx(handle, opa, opb, (int)m, (int)n, (int)k, (void*)&falpha, a, CUDA_R_16BF, (int)lda, stridea, b, CUDA_R_16BF, (int)ldb, strideb, (void*)&fbeta, c, CUDA_R_16BF, (int)ldc, stridec, (int)num_batches, compute_type, CUBLAS_GEMM_DEFAULT_TENSOR_OP)

因为我使用的显卡是M40,比较久,不支持bf16功能,虽然程序上进行了判断,但是会出现RuntimeError,所以直接把“pdf_parse_union_core_v2.py”文件中287-290四行(不同版本可能位置不一样)代码的
if torch.cuda.is bf16 supported():
supports bfloat16 =True
else:
supports bfloat16=False
改成:
supports bfloat16=False

直接把bf16写成false。
因为bf16是要turing架构之后的卡才支持。
这样就OK了

Operating system | 操作系统

Windows

Python version | Python 版本

3.10

Software version | 软件版本 (magic-pdf --version)

1.0.x

Device mode | 设备模式

cuda

@myhloli
Copy link
Collaborator

myhloli commented Jan 11, 2025

#1512

@myhloli myhloli closed this as completed Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants