Jetson Orin Nano Super無法安裝Whisper

設備資訊
caesar@ubuntu: $ nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Aug_14_10:14:07_PDT_2024
Cuda compilation tools, release 12.6, V12.6.68
Build cuda_12.6.r12.6/compiler.34714021_0

caesar@ubuntu: $ cat /etc/nv_tegra_release

# KERNEL_VARIANT: oot

R36 (release), REVISION: 4.4, GCID: 41062509, BOARD: generic, EABI: aarch64, DATE: Mon Jun 16 16:07:13 UTC 2025
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia

nvidia-smi
NVIDIA-SMI 540.4.0
Drive Version:540.4.0
Cuda Version 12.6
Orin(nvgpu)

python3 --version
pip 22.0.2
pip3 --version
Python 3.10.12

=======================================================================
安裝torch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126

檢查
Python3

import torch
print(torch.cuda.is_available())
True
print(torch.cuda.get_device_name(0))
Orin

=======================================================================
pip3 install openai-whisper
pip3 install huggingface_hub

這裡報錯
python3 -c “import whisper; whisper.load_model(‘base’)”

Traceback (most recent call last):
File “”, line 1, in
File “/home/caesar/.local/lib/python3.10/site-packages/whisper/init_.py”, line 155,in load_model
model.load_state_dict(checkpoint[“model_state_dict”])
File “/home/caesar/.local/lib/python3.10/site-packages/torch/nn/modules/module.py”, line in load_state_dict
raise RuntimeError(
RuntimeErrorг: Еггог(s) in loading state_dict for Whisper:
While copying the parameter named “encoder.blocks.0.attn.query.weight”, whose dimens in the model are torch. Size([512, 512]) and whose dimensions in the checkpoint are torch.Siz 2, 512]), an exception occurred: ('CUDA error: no kernel image is available for execution o device\nCUDA kernel errors might be asynchronously reported at some other API call, so the trace below might be incorrect.\nFor debugging consider passing CUDA_LAUNCH_BLOCKING=1\nComp ith TORCH_USE_CUDA_DSA to enable device-side assertions.\n’,)

嘗試幾個PYTORCH版本都不行,求各位大大指點!

Hello,

Thanks for visiting the NVIDIA Developer forums.

Your topic will be best served in the Jetson category, I have moved this post for better visibility.

Cheers,
Tom

Hi,

Could you try to build it from the source to see if it can work?
You can follow the steps in the below Dockerfile:

Thanks.

Thank you for your reply. I compared the two files and found no discrepancies.

#---
# name: whisper
# group: audio
# depends: [numba, numpy, pytorch, torchaudio, jupyterlab]
# requires: '>=34.1.0'
# docs: docs.md
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

WORKDIR /opt

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
                  ffmpeg \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean

RUN pip3 install pandas scipy jiwer ipywebrtc

ADD https://api.github.com/repos/openai/whisper/git/refs/heads/main /tmp/whisper_version.json

# Clone the repository:
RUN git clone https://github.com/openai/whisper/ && \
    cd whisper && \
    sed -i 's/==/>=/g' requirements.txt && \
    sed -i 's/~=/>=/g' requirements.txt && \
    cat requirements.txt && \
    pip3 wheel --wheel-dir=dist --no-deps --verbose .

RUN cp whisper/dist/openai_whisper*.whl /opt && \
    pip3 install /opt/openai_whisper*.whl

WORKDIR /opt/whisper/

COPY record-and-transcribe.ipynb /opt/whisper/notebooks

RUN openssl req \
        -new \
        -newkey rsa:4096 \
        -days 365 \
        -nodes \
        -x509 \
        -keyout mykey.key \
        -out mycert.pem \
        -subj '/CN=localhost'

CMD /bin/bash -c "jupyter lab --ip 0.0.0.0 --port 8888  --certfile=mycert.pem --keyfile mykey.key --allow-root &> /var/log/jupyter.log" & \
        echo "allow 10 sec for JupyterLab to start @ https://$(hostname -I | cut -d' ' -f1):8888 (password nvidia)" && \
        echo "JupterLab logging location:  /var/log/jupyter.log  (inside the container)" && \
        /bin/bash

Hi,

Do you build it from the source or install it from pip3?
The prebuilt might not include the Orin GPU architecture so the CUDA function cannot work correctly.

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.