From 47b2e6aee158b6beaed0a27d792bff9cafc2a8ca Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Sun, 14 May 2023 13:11:21 +0100 Subject: [PATCH] Add Python-dev to Dockerfile. /download/alpaca-lora[main]$ docker run --gpus=all --shm-size 64g -p 7860:7860 -v ${HOME}/.cache:/root/.cache --rm alpaca-lora generate.py \ --load_8bit \ --base_model 'decapoda-research/llama-7b-hf' \ --lora_weights 'tloen/alpaca-lora-7b' /usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:145: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/usr/local/nvidia/lib64'), PosixPath('/usr/local/nvidia/lib')} warn(msg) /usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:145: UserWarning: /usr/local/nvidia/lib:/usr/local/nvidia/lib64 did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths... warn(msg) /usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:145: UserWarning: Found duplicate ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] files: {PosixPath('/usr/local/cuda/lib64/libcudart.so'), PosixPath('/usr/local/cuda/lib64/libcudart.so.11.0')}.. 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) /tmp/tmph7ozgb_9/main.c:3:10: fatal error: Python.h: No such file or directory 3 | #include | ^~~~~~~~~~ compilation terminated. Traceback (most recent call last): File "/workspace/generate.py", line 8, in --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f6599a08..1c710a5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y \ curl \ software-properties-common \ && add-apt-repository ppa:deadsnakes/ppa \ - && apt install -y python3.10 \ + && apt install -y python3.10 python3.10-dev\ && rm -rf /var/lib/apt/lists/* WORKDIR /workspace COPY requirements.txt requirements.txt