Skip to content

CUDA_VISIBLE_DEVICES ignored by Chat interface in multi-GPU setup (defaults to GPU 0) #5025

Description

@PASiChen

I am using Unsloth Studio in a multi-GPU environment (RTX 3070 at Index 0 and RTX 5090 at Index 1). While the Studio successfully detects the 5090 upon startup (verified via logs), the Chat interface consistently loads the model into the VRAM of the RTX 3070 (GPU 0) instead of the specified device.

I have tried the following to force the 5090 usage, but the Chat backend still defaults to the 3070:

  • Inline Environment Variables: CUDA_VISIBLE_DEVICES=1 unsloth studio -H 0.0.0.0 -p 8888
  • Exported Variables: Running export CUDA_VISIBLE_DEVICES=1 prior to launch.
  • Backend Specific Flags: Setting export GGML_CUDA_VISIBLE_DEVICES=1.
  • .env File: Created a .env file in the root directory with CUDA_VISIBLE_DEVICES=1.

The best result I got is that the startup log correctly says "Hardware detected: RTX 5090", but clicking "Load" in the Chat UI still populates the RTX 3070 VRAM.

I installed with Developer installs for Linux. I'm on Ubuntu 24.04.4 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions