在末尾添加行export CUDA_VISIBLE_DEVICES="1"

tensorflow-gpu+"Failed to create session"

  1. 层面1: 针对各个虚拟环境:
    修改~/.virtualenv/YOUR_VENV/bin/postactivate, 在末尾添加行export CUDA_VISIBLE_DEVICES="1"即可.

  2. 层面2: 针对系统用户:
    同上修改~/.bashrc在末尾添加行export CUDA_VISIBLE_DEVICES="1"

 

C:\Users\16079>wsl.exe -d Ubuntu-24.04 hkw@localhost:/mnt/c/Users/16079$ nano ~/.bashrc hkw@localhost:/mnt/c/Users/16079$ ollama serve Error: listen tcp 172.18.0.2:11434: bind: cannot assign requested address hkw@localhost:/mnt/c/Users/16079$ nano ~/.bashrc hkw@localhost:/mnt/c/Users/16079$ nano ~/.bashrc hkw@localhost:/mnt/c/Users/16079$ ollama serve Error: listen tcp 172.18.0.2:11434: bind: cannot assign requested address hkw@localhost:/mnt/c/Users/16079$ export OLLAMA_HOST=0.0.0.0:11434 ollama serve 2025/03/13 19:55:18 routes.go:1125: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/home/hkw/.ollama/models OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://*] OLLAMA_RUNNERS_DIR: OLLAMA_SCHED_SPREAD:false OLLAMA_TMPDIR: ROCR_VISIBLE_DEVICES:]" time=2025-03-13T19:55:18.170+08:00 level=INFO source=images.go:753 msg="total blobs: 5" time=2025-03-13T19:55:18.171+08:00 level=INFO source=images.go:760 msg="total unused blobs removed: 0" time=2025-03-13T19:55:18.171+08:00 level=INFO source=routes.go:1172 msg="Listening on [::]:11434 (version 0.3.9)" time=2025-03-13T19:55:18.176+08:00 level=INFO source=payload.go:30 msg="extracting embedded files" dir=/tmp/ollama724607946/runners time=2025-03-13T19:55:24.162+08:00 level=INFO source=payload.go:44 msg="Dynamic LLM libraries [cpu cpu_avx cpu_avx2 cuda_v11 cuda_v12 rocm_v60102]" time=2025-03-13T19:55:24.162+08:00 level=INFO source=gpu.go:200 msg="looking for compatible GPUs" time=2025-03-
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值