프로그램 사용/ai 프로그램

gpt님 만세! - pip torch 버전 낮추기

구차니 2026. 5. 15. 12:35

이런저런 에러를 내면서 못도는거

home/minimonk/.local/lib/python3.10/site-packages/torch/cuda/__init__.py:384: UserWarning: Found GPU0 NVIDIA GeForce GTX 1080 Ti which is of compute capability (CC) 6.1.
The following list shows the CCs this version of PyTorch was built for and the hardware CCs it supports:
- 7.5 which supports hardware CC >=7.5,<8.0
- 8.0 which supports hardware CC >=8.0,<9.0 except {8.7}
- 8.6 which supports hardware CC >=8.6,<9.0 except {8.7}
- 9.0 which supports hardware CC >=9.0,<10.0
- 10.0 which supports hardware CC >=10.0,<11.0 except {10.1}
- 12.0 which supports hardware CC >=12.0,<13.0
Please follow the instructions at https://pytorch.org/get-started/locally/ to install a PyTorch release that supports one of these CUDA versions: 12.6
  _warn_unsupported_code(d, device_cc, code_ccs)
/home/minimonk/.local/lib/python3.10/site-packages/torch/cuda/__init__.py:384: UserWarning: Found GPU1 NVIDIA GeForce GTX 1080 Ti which is of compute capability (CC) 6.1.
The following list shows the CCs this version of PyTorch was built for and the hardware CCs it supports:
- 7.5 which supports hardware CC >=7.5,<8.0
- 8.0 which supports hardware CC >=8.0,<9.0 except {8.7}
- 8.6 which supports hardware CC >=8.6,<9.0 except {8.7}
- 9.0 which supports hardware CC >=9.0,<10.0
- 10.0 which supports hardware CC >=10.0,<11.0 except {10.1}
- 12.0 which supports hardware CC >=12.0,<13.0
Please follow the instructions at https://pytorch.org/get-started/locally/ to install a PyTorch release that supports one of these CUDA versions: 12.6
  _warn_unsupported_code(d, device_cc, code_ccs)
/home/minimonk/.local/lib/python3.10/site-packages/torch/cuda/__init__.py:502: UserWarning: 
NVIDIA GeForce GTX 1080 Ti with CUDA capability sm_61 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_75 sm_80 sm_86 sm_90 sm_100 sm_120.
If you want to use the NVIDIA GeForce GTX 1080 Ti GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

 

torch.AcceleratorError: CUDA error: no kernel image is available for execution on the device
Search for `cudaErrorNoKernelImageForDevice' in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html for more information.
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

 

cu118로 낮추니 잘된다. 만세!

pip3 uninstall -y torch triton
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

 

 

.이거면.. openai 쪽 api도 필요없고

허깅페이스에서 모델만 받으면 어떻게 해결 될 듯 한데

그래도 KURE-v1이 가볍단 해도 아주 가벼운건 또 아니네..

python3                                2354MiB

 

일단은 잘 돌아가는 것 같은니. pgvector랑 연동해보자 ㅋㅋ

>>> from sentence_transformers import SentenceTransformer
>>> from sklearn.metrics.pairwise import cosine_similarity
>>> 
>>> model = SentenceTransformer("nlpai-lab/KURE-v1")
Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
Loading weights: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 391/391 [00:00<00:00, 1080.33it/s]
>>> 
>>> documents = [
...     "고양이가 소파 위에 앉아 있다.",
...     "강아지가 공원에서 뛰어논다.",
...     "반려동물이 집에서 쉬고 있다."
... ]
>>> 
>>> query = "집 안의 동물"
>>> 
>>> doc_embeddings = model.encode(
...     documents,
...     normalize_embeddings=True
... )
>>> 
>>> query_embedding = model.encode(
...     query,
...     normalize_embeddings=True
... )
>>> 
>>> scores = cosine_similarity(
...     [query_embedding],
...     doc_embeddings
... )[0]
>>> 
>>> for doc, score in zip(documents, scores):
...     print(f"{score:.4f} : {doc}")
... 
0.6314 : 고양이가 소파 위에 앉아 있다.
0.6035 : 강아지가 공원에서 뛰어논다.
0.7798 : 반려동물이 집에서 쉬고 있다.

 

혹시나 해서 찾아본 cuda 1 번으로 돌리는 방법

sentence_transformer
nlpai-lab/KURE-v1


from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity

model = SentenceTransformer("nlpai-lab/KURE-v1", device="cuda:1")

documents = [
    "고양이가 소파 위에 앉아 있다.",
    "강아지가 공원에서 뛰어논다.",
    "반려동물이 집에서 쉬고 있다."
]

query = "집 안의 동물"

doc_embeddings = model.encode(
    documents,
    normalize_embeddings=True
)

query_embedding = model.encode(
    query,
    normalize_embeddings=True
)

scores = cosine_similarity(
    [query_embedding],
    doc_embeddings
)[0]

for doc, score in zip(documents, scores):
    print(f"{score:.4f} : {doc}")

 

좋아좋아 gpu 1번 ㅋㅋ