AU
  
You are currently viewing the Australia version of the site.
Would you like to switch to your local site?
13 MIN READ TIME

Art beyond the canvas

Tam Hanna takes a look at running the Stable Diffusion image generator on your local Linux systems.

WHY ARE VIRTUAL ENVIRONMENTS NEEDED?

TROUBLESHOOTING!

Painting of a helicopter

Working with Python on a pure command-line level is hairy. Modern Python apps include a vast ecosystem of third-party libraries. As with Windows applications, these third-party libraries are developed independently of the application code hosted in users’ workstations. Given that library development often leads to

Nvidia drivers are a fickle bunch. If the first execution of Stable Diffusion works, consider yourself extraordinarily lucky. Usually, various problems occur.

Painting of a laptop

API breaks, keeping a Python program working can become difficult over time. If multiple Python programs are hosted on the same workstation, conflict about library versions is inevitable. The situation gets quixotic if Python is used for system tasks – common in modern Linux environments.

Firstly, be aware of the command-line utility Nvidiasmi. It provides a taskmanager-like overview of things happening, and works especially well when combined with watch .

Painting of a man in a suit

The Python community’s workaround for this is the virtual environment; think of it as an installation of Python and the library collection dedicated to only one application. In this way, every individual program finds its preferred Python environment and can be run without issues. On the other hand, as you’d expect, hosting multiple virtual environments does come with a price in terms of storage used.

Two error messages are common. Firstly, the message ‘RuntimeError: CUDA error: all CUDAcapable devices are busy or unavailable’. It usually indicates that the graphics accelerator is blocked by another process. Use Nvidiasmi to look for any process marked E and terminate it. Sometimes, simply running the script again two or three seconds later can fix the problem. Errors along the lines of ‘UserWarning: CUDA initialization: CUDA unknown error – this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_ DEVICES after program start. Setting the available devices to be zero’ are insidious. They are caused by an interaction between the suspend system of Linux and the GPU drivers – Nvidia’s driver code is notoriously unhappy about having to resume work after hibernation. If this is the case on your machine, a reboot, login and execution of the script usually fixes the problem. A detailed discussion of the problem can also be found at: https:// bit.ly/lxf302cuda.

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for $1.48
SUBSCRIBE NOW
30 day trial, then just $14.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
June 2023
VIEW IN STORE

Other Articles in this Issue


LINUX FORMAT
LINUX FORMAT
The #1 open source mag Future Publishing Limited,
WELCOME
MEET THE TEAM
We’re looking at all manner of hacks this issue, from using Kali Linux to Hackfest and robot builds. What was your favourite hack?
Hacking away
It was a great experience to attend the
REGULARS AT A GLANCE
Newsdesk
THIS ISSUE: Ubuntu ties knot with RISC-V »
RISC-V on Ubuntu
Developers at Canonical and the RISC-V Foundation have been pulling out all the stops to marry everyone’s favourite distro with RISC-V.
Deutsche Telekom picks Collabora Online
An open source online office suite is now available to Telekom customers in Germany and Austria.
Storm in a Docker container?
Announcement causes confusion among customers.
LINUX FOCUSED
Keith Edmunds is MD of Tiger Computing, which
BACK TO BASICS
Joe Brockmeier is head of community, Percona. "There
Happy birthday to Curl!
As Curl turns 25, version 8.0.0 is released.
Multi-core improvements
Intel engineers have tweaked optimisations for the Linux kernel.
Google boosts VM performance
Google engineers release patches to improve KVMbased virtual machines.
Distro watch
What’s behind the free software sofa?
NEW DRIVER
Boris Brezillon is a senior software engineer at
CONFLICTS
Jon Masters is a kernel hacker who’s been
Kernel watch
Jon Masters keeps up with all the latest happenings in the Linux kernel, so you don’t have to.
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to answers@linuxformat.com
Mails rver
MAILSERVER WRITE TO US Do you have a
HotPicks
System Monitoring Center Universal Media Server Element Carbonyl Nushell Tonfotos Conjure Space Station 14 Crispy Doom Singlebox Rymdport
UBUNTU 23.04 FAST AND LIGHT!
We take the latest Ubuntu release and sprinkle a little LXF magic on it, so it runs faster and lighter than ever before!
REVIEWS
LDO V0-S1 Voron 0.1
Denise Bertacchi thinks you can take DIY too far…
AMD Radeon RX 7900 XTX
It’s AMD’s fastest graphics card, powered by chiplets, cries Jacob Ridley.
Trisquel 11.0 Aramo
Nate Drake goes from being a Boy and his Blob to Trisquel, a truly free open source and blobless operating system.
Ubuntu 23.04 Lunar Lobster
Nate Drake finds this Lobster Linux to be a snappy dresser, with the stunning latest version of Gnome and improved settings.
Dome Keeper
The Management likes to think the monsters in the LXF dungeon are incentivisation multipliers. Jon Bailes is too busy mining a way out to argue.
ROUNDUP
Firewall distros
WE COMPARE TONS OF STUFF SO YOU DON’T HAVE TO!
Installation and setup
How simple are these firewalls to fire up?
Configuration and management
How easy do these firewalls make life for network admins?
Updates and upgrades
Which firewalls are easiest to keep in the loop?
Security features
How seriously do these firewalls take your safety?
Help and support
When all else fails, can you read the manual?
Cloud support
Which firewalls take to the cloud best of all?
Stability
Will your chosen firewall still be here 10 years from now?
The Verdict
Firewall distros
Master hacking with Kali
Daring David Rutland dons his black hoodie and joins the red team to try out Kali Linux from Offensive Security.
Ice cold with Kali
Kali is essentially a collection of tools gathered over the decades, and packaged in an easy-to-use, logical way.
Get to grips with Kali
Kali Linux enables amateurs and pros alike to take security into their own hands and carry out attacks on their own networks and equipment.
Metasploitation
No computer program is perfect and it’s not possible to predict every output for every input as neither humans nor computers are omniscient.
Chase the purple dragon
There are people who want to break into networks and machines, and people who try to stop them, known as red teams and blue teams.
Pi USER
Ada Computer Science platform launched
An English curriculum-mapped resource for GCSE and A-level grade students. Fill your boots!
Pico gets video-out with Adafruit
The latest microcontroller RP2040 comes with advanced visual goodies.
SPRING IS BEARING FRUIT
Les Pounder works with groups such as the
Argon ONE NVMe
Feeling the need, the need for 1980s film references, Les Pounder tries out a speedy Pi solution.
Pico Bricks
Learn all about electronics and programming with a simple, Pico-based kit and Les Pounder!
Boot your Pi faster from USB storage
Les Pounder feels the need, the need for speeding up his Raspberry Pi 4 using USB 3…
Robot object detection, side motion and video
To put the electronic cherry on Les Pounder’s finished robot, we add sonar sound, streaming video and sideways motion.
TOP OF THE FOSS!
Vanilla OS
Matt Holder discovers that Vanilla OS is anything but vanilla.
It’s Collabora time!
At Clare College, Cambridge, Neil Mohr catches up with the Collabora Online team to discover what’s state of the art in the online office world.
TUTORIALS
Check your disk usage
There are many vanilla tools that tell you the amount of free disk space but Shashank Sharma prefers one that values style as well as substance.
Speed up text-based tasks with Espanso
Nick Peers reveals how to boost your productivity with a free text replacement tool that has a multitude of different uses.
ALGOL: the father of mainstream languages
Time traveller Mike Bedford steps back 65 years to the birth of high-level languages and looks at ALGOL, the language that started a revolution.
Scale, repair and enhance your photos
G’MIC is a treasure chest with virtually inexhaustible content. But how do you use it? Karsten Günther helps open the box and explore the contents.
Rescuing data from legacy floppy disks
Matt Holder discovers that rescuing data from 20-yearold floppy disks is a lot more difficult than expected.
Relive the history of tracker music
Michael Reed looks at the history of so-called tracker music and explores some of the Linux tools that can work with that format.
CODING ACADEMY
Add controllers and menus with OpenGL
Never a man to miss deadlines, Andrew Smith stays in control adding mouse menus to our OpenGL-powered 3D chess game.
ADVERTISEMENT
GO. COMPARE
go.compare
Magazinesdirect
www.magazinesdirect.com/LIN/B74L
Magazinesdirect
magazinesdirect.com
Magazinesdirect
magazinesdirect.com
Magazinesdirect
www.magazinesdirect.com
Linux
www.magazinesdirect.com/linux-format
codeclub
www.codeclub.org.uk
EFF
EFF.ORG
The braintumour charity
thebraintumourcharity.org
Chat
X
Pocketmags Support