문제 : wsl2 에서 pybullet 사용 시 아래와 같은 에러 발생 시
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
해결법 : 아래 코드 실행
ln -s -f /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30 $CONDA_PREFIX/lib/libstdc++.so.6
문제 : WSL2에서 CPU memory 초과 에러 발생
2024-11-11 17:13:04.770221: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 235929600 exceeds 10% of free system memory.
2024-11-11 17:13:04.890095: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 235929600 exceeds 10% of free system memory.
2024-11-11 17:13:05.145305: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 235929600 exceeds 10% of free system memory.
2024-11-11 17:13:05.250578: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 235929600 exceeds 10% of free system memory.
2024-11-11 17:13:08.342868: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 2595840000 exceeds 10% of free system memory.
해결법 :
기본적으로 WSL2가 사용할 수 있는 메모리가 제한적일 수 있다. /etc/wsl.conf
파일에 메모리 설정을 추가하여 WSL2가 사용할 수 있는 메모리를 늘릴 수 있다.
wsl.conf
파일을 열어 다음과 같이 설정, 설정을 적용하려면 WSL2를 재시작해야함.
[wsl2]
memory=4GB
스왑 메모리를 설정하여 메모리 부족을 완화할 수 있다. 아래 명령어를 통해 추가 스왑 메모리를 생성하.
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile