質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.31%
WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

機械学習

機械学習は、データからパターンを自動的に発見し、そこから知能的な判断を下すためのコンピューターアルゴリズムを指します。人工知能における課題のひとつです。

Q&A

解決済

1回答

1399閲覧

WSL2環境でGPUをモデルが認識しない

hazawa

総合スコア6

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

機械学習

機械学習は、データからパターンを自動的に発見し、そこから知能的な判断を下すためのコンピューターアルゴリズムを指します。人工知能における課題のひとつです。

0グッド

0クリップ

投稿2023/09/09 00:30

編集2023/09/09 01:23

WSLのUbuntu内でtransformer,bitsoudbyteをインポートしたのですが、以下のエラーが発生します。
GPUをWSL上で認識できていないようですが、原因などわかる方教えていただきたいです。

発生している問題・エラーメッセージ

===================================BUG REPORT=================================== Welcome to bitsandbytes. For bug reports, please run python -m bitsandbytes and submit this information together with your error trace to: https://github.com/TimDettmers/bitsandbytes/issues ================================================================================ bin /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/cextension.py:34: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers, 8-bit multiplication, and GPU quantization are unavailable. warn("The installed version of bitsandbytes was compiled without GPU support. " /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so: undefined symbol: cadam32bit_grad_fp32 /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('unix')} warn(msg) /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: Found duplicate ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] files: {PosixPath('/usr/local/cuda/lib64/libcudart.so.11.0'), PosixPath('/usr/local/cuda/lib64/libcudart.so')}.. We'll flip a coin and try one of these, in order to fail forward. Either way, this might cause trouble in the future: If you get `CUDA error: invalid device function` errors, the above might be the cause and the solution is to make sure only one ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] in the paths that we search based on your env. warn(msg) CUDA exception! Error code: no CUDA-capable device is detected CUDA exception! Error code: initialization error CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so.11.0 /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: No GPU detected! Check your CUDA paths. Proceeding to load CPU-only library... warn(msg) CUDA SETUP: Detected CUDA version 118 CUDA SETUP: Loading binary /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so... 0 model download The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function. Traceback (most recent call last): File "/home/shimizu/create_LLM/macin/work2/train.py", line 47, in <module> model = AutoModelForCausalLM.from_pretrained(#モデルのダウンロード File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 464, in from_pretrained return model_class.from_pretrained( File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2478, in from_pretrained ) = cls._load_pretrained_model( File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2797, in _load_pretrained_model new_error_msgs, offload_index, state_dict_index = _load_state_dict_into_meta_model( File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 665, in _load_state_dict_into_meta_model set_module_8bit_tensor_to_device(model, param_name, param_device, value=param) File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/transformers/utils/bitsandbytes.py", line 71, in set_module_8bit_tensor_to_device new_value = bnb.nn.Int8Params(new_value, requires_grad=False, has_fp16_weights=has_fp16_weights).to(device) File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/nn/modules.py", line 294, in to return self.cuda(device) File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/nn/modules.py", line 258, in cuda CB, CBt, SCB, SCBt, coo_tensorB = bnb.functional.double_quant(B) File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/functional.py", line 1987, in double_quant row_stats, col_stats, nnz_row_ptr = get_colrow_absmax( File "/home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/functional.py", line 1876, in get_colrow_absmax lib.cget_col_row_stats(ptrA, ptrRowStats, ptrColStats, ptrNnzrows, ct.c_float(threshold), rows, cols) File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /home/shimizu/create_LLM/macin/work2/venv/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so: undefined symbol: cget_col_row_stats

該当のソースコード

python

1print("model download") 2model = AutoModelForCausalLM.from_pretrained(#モデルのダウンロード 3 MODEL_NAME, 4 device_map=device_map, 5 load_in_8bit=True #これがないと動く 6 7)

試したこと

nvidiaドライバ、toolkitのインストール +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.104.05 Driver Version: 537.13 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | 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 4060 Ti On | 00000000:01:00.0 On | N/A | | 0% 43C P8 9W / 165W | 688MiB / 16380MiB | 4% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 269 G /Xwayland N/A | +---------------------------------------------------------------------------------------+ nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:33:58_PDT_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0
(venv) :~/work2$ apt show cuda Package: cuda Version: 12.2.2-1 Priority: optional Section: multiverse/devel Maintainer: cudatools <cudatools@nvidia.com> Installed-Size: 7168 B Depends: cuda-12-2 (>= 12.2.2) Download-Size: 2466 B APT-Sources: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages Description: CUDA meta-package Meta-package containing all the available packages required for native CUDA development. Contains the toolkit, samples, driver and documentation. N: There are 9 additional records. Please use the '-a' switch to see them.

補足情報(FW/ツールのバージョンなど)

nvidiaの導入手順はここを参考にしました
https://www.kkaneko.jp/tools/wsl/wsl_tensorflow2.html
windowsでbitsandbytesが導入できなかったのでここを参考に導入しました。
https://qiita.com/selllous/items/c4880767da45173227c1

OS windows 11 home
wsl のLinuxバージョン
Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

aaaaaaaaaaaaa

投稿2023/09/30 11:26

hazawa

総合スコア6

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.31%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問