QwenLM / Qwen

The official repo of Qwen (通义千问) chat & pretrained large language model proposed by Alibaba Cloud.
Apache License 2.0
13.59k stars 1.11k forks source link

使用官方cuda121的docker镜像加载自己finetune的lora模型时报错[BUG] <title> #1159

Closed michaelyu0906 closed 6 months ago

michaelyu0906 commented 6 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

正确安装了nvidia-container-toolkit,能够顺利运行官方hello word镜像。 基于qwenllm/qwen:cu121的镜像构建自定义镜像加载finetune后的模型,发现模型加载到了cpu上;尝试使用model.cuda()时报错/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:138: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 804: forward compatibility was attempted on non supported HW (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.) 在容器中使用nvidia-smi命令能够正确显示显卡

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

No response

jklj077 commented 6 months ago

You may need to update your nvidia driver to a version that support cuda 12.1.