You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run --rm --gpus all nvidia/cuda:12.0.1-runtime-ubuntu22.04 nvidia-smi
Unable to find image 'nvidia/cuda:12.0.1-runtime-ubuntu22.04' locally
12.0.1-runtime-ubuntu22.04: Pulling from nvidia/cuda
aece8493d397: Pull complete
72951eebaee1: Pull complete
6380df36b797: Pull complete
dce5449f8cbe: Pull complete
fea6c9fe8a9b: Pull complete
4a1fbbf21bd0: Pull complete
1b99e878d962: Pull complete
622df319ef96: Pull complete
7c3b140ed2ea: Pull complete
Digest: sha256:912e635ceffa8c2895e1cc693fd1dc5b5b920e178583cb34ed84a903b439601b
Status: Downloaded newer image for nvidia/cuda:12.0.1-runtime-ubuntu22.04
==========
== CUDA ==
==========
CUDA Version 12.0.1
Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
Sun Apr 13 15:37:06 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.86.16 Driver Version: 572.16 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3070 ... On | 00000000:01:00.0 Off | N/A |
| N/A 64C P8 14W / 105W | 1196MiB / 8192MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
没事,如果驱动能正常使用的话,可以直接在 docker container 里验证一下 torch 是否能正确调用 cuda 核心:
importtorchdefcheck_cuda_with_pytorch():
"""Check if the PyTorch CUDA environment is working correctly"""try:
print("Checking PyTorch CUDA environment:")
iftorch.cuda.is_available():
print(f"CUDA device is available, the current CUDA version is: {torch.version.cuda}")
print(f"PyTorch version is: {torch.__version__}")
print(f"Detected {torch.cuda.device_count()} CUDA devices.")
foriinrange(torch.cuda.device_count()):
print(f"Device {i}: {torch.cuda.get_device_name(i)}")
print(f"Device {i} total memory: {torch.cuda.get_device_properties(i).total_memory/ (1024**3):.2f} GB")
print(f"Device {i} current memory usage: {torch.cuda.memory_allocated(i) / (1024**3):.2f} GB")
print(f"Device {i} max memory usage: {torch.cuda.memory_reserved(i) / (1024**3):.2f} GB")
else:
print("CUDA device is not available.")
exceptExceptionase:
print(f"Error when checking PyTorch CUDA environment: {e}")
if__name__=="__main__":
check_cuda_with_pytorch()
Activity
timerring commentedon Mar 24, 2025
wsl 跑 nvidia gpu docker,需要
nvidia-container-toolkit等配置。参考官方文档:https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
OrdinarySF commentedon Mar 24, 2025
安装过
timerring commentedon Mar 28, 2025
好的,
nvcc -Vcuda 版本是多少OrdinarySF commentedon Apr 3, 2025
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Fri_Feb_21_20:23:50_PST_2025
Cuda compilation tools, release 12.8, V12.8.93
Build cuda_12.8.r12.8/compiler.35583870_0
timerring commentedon Apr 4, 2025
单独运行一下识别模块,看一下输出结果,
python src/subtitle/generate.py path/to/videotimerring commentedon Apr 13, 2025
或者直接拉个镜像验证一下。
docker run --rm --gpus all nvidia/cuda:12.0.1-runtime-ubuntu22.04 nvidia-smiOrdinarySF commentedon Apr 13, 2025
@timerring sorry最近有点忙
timerring commentedon Apr 14, 2025
没事,如果驱动能正常使用的话,可以直接在 docker container 里验证一下 torch 是否能正确调用 cuda 核心:
OrdinarySF commentedon Apr 19, 2025
看起来不可用
timerring commentedon Apr 20, 2025
好的,大概率还是
CUDA的问题,建议检查一下环境,确保 CUDA cores 可以正常被调用。[-][Help] wsl docker gpu version 无法正常转换字幕[/-][+][Help] wsl docker 调用 cuda 核心的问题[/+]OrdinarySF commentedon Apr 27, 2025
重新拉取了最新版镜像,问题解决