Page 1 of 2

Valve Steam on Porteus

Posted: 03 Feb 2014, 12:47
by ztealmax
Hi ive downloaded Porteus 3.0
and steam_latest.deb and converted it to porteus package
did a installation and all worked great
Im running porteus with AMD drivers
ok now started steam it starts up with following message: OpenGL GLX context is not using direct rendering, which may couse performance problems
Guess something is missing?
I can play Counter-Strike 1.6 with out OpenGL GLX direct rendering but thats about it.

So my question is what is missing? Mesa drivers?

Any suggestion would be great

GLXINFO

Code: Select all

glxinfo
name of display: :0.0
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
display: :0  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
Martin

Re: Valve Steam on Porteus

Posted: 03 Feb 2014, 20:24
by brokenman
Did you start the program with: LIBGL_DEBUG=verbose?

I also suggest you open google and copy and paste that error message in. There are tons of hits and your answer most probably has already been posted. For example if you are on 64bit you may well need the 32bit compat libraries.

Re: Valve Steam on Porteus

Posted: 03 Feb 2014, 20:42
by ztealmax
brokenman wrote:Did you start the program with: LIBGL_DEBUG=verbose?

I also suggest you open google and copy and paste that error message in. There are tons of hits and your answer most probably has already been posted. For example if you are on 64bit you may well need the 32bit compat libraries.

Hia brokenman: yes i have the 32-bit libs needed, but as far as i have figured out, i think steam installs something that alter the amd drivers or how they behave, ill keep you posted when i get a answer
and yes ive googled it ;)

Sincerally
M

Re: Valve Steam on Porteus

Posted: 03 Feb 2014, 21:45
by fanthom
looks like the issue we had before and i still dont know wtf is causing it:
http://forum.porteus.org/viewtopic.php? ... 741#p19157

please let me know if you find which module/other action does opengl switch from catalyst to mesa.
thanks

Re: Valve Steam on Porteus

Posted: 09 Feb 2014, 12:59
by ztealmax
Yea what i can see so far is that steam installs allready installed files that overides catalyst driver allready installed, perhaps maybe if we mod the steam script not to
install mesa etc it could work

think perhaps file we should concentrate on is: steamdeps.sh

Code: Select all

#!/usr/bin/env python
"""
	This script handles installing system dependencies for games using the
	Steam runtime.  It is intended to be customized by other distributions
	to "do the right thing"

	Usage: steamdeps dependencies.txt
"""

import os
import re
import stat
import subprocess
import sys
import tempfile

# This is the set of supported Steam runtime environments
SUPPORTED_STEAM_RUNTIME = [ '1' ]

# This is the set of supported dependency formats
SUPPORTED_STEAM_DEPENDENCY_VERSION = [ '1' ]

###
# Get the current package architecture
# This may be different than the actual architecture for the case of i386
# chroot environments on amd64 hosts.
_arch = None
def getArch():
	"""
	Get the current architecture
	"""
	global _arch

	if ( _arch is None ):
		_arch = subprocess.check_output(['dpkg', '--print-architecture']).decode("utf-8").strip()
	return _arch


###
def getFullPackageName( name ):
	"""
	Get the full name of a package, qualified by architecture
	"""
	if ( name.find(":") < 0 ):
		return name + ":" + getArch()
	else:
		return name

#
# Check to see if another package Provides this package
# N.B. Version checks are not supported on virtual packages
#
def isProvided(pkgname):
	try:
		process = subprocess.Popen( ['apt-cache', 'showpkg', pkgname], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
		pattern = re.compile( r'^Reverse Provides\:')
		providers = {}
		for line in process.stdout:
			if re.match(pattern,line):
				for provider in process.stdout:
					(name, version) = provider.split()
					providers[name] = version
				for provider in providers.keys():
					if hasPackage(provider):
						return True
				return False
	except:
		return False
	return False


###
class Package:
	"""
	Package definition class
	"""
	def __init__(self, name, versionConditions):
		self.name = name
		self.versionConditions = versionConditions
		self.installed = None

	def setInstalled(self, version):
		self.installed = version


	def isAvailable(self):
		if ( self.installed is None ):
			# check to see if another package is providing this virtual package
			return isProvided(self.name)

		for (op, version) in self.versionConditions:
			if ( subprocess.call( ['dpkg', '--compare-versions', self.installed, op, version] ) != 0 ):
				return False

		return True

	def __str__(self):
		text = self.name
		for (op, version) in self.versionConditions:
			text += " (%s %s)" % (op, version)
		return text


###
def hasPackage( package ):
	process = subprocess.Popen( ['dpkg', '-l', package], stdout=subprocess.PIPE, stderr=subprocess.PIPE )
	installed_pattern = re.compile( r"^\Si\s+([^\s]+)\s+([^\s]+)" )
	for line in process.stdout:
		line = line.decode( "utf-8" ).strip()
		match = re.match( installed_pattern, line )
		if ( match is None ):
			continue

		return True
	return False


def remapPackage( description ):

	# Ubuntu 12.04.2 and 12.04.3 both introduce new X stacks which require 
	# two different sets of incompatible glx packages depending on which X 
	# is currently installed.

	if hasPackage( "xserver-xorg-core-lts-quantal" ):
		if description == "libgl1-mesa-glx:i386":
			return "libgl1-mesa-glx-lts-quantal:i386"
		elif description == "libgl1-mesa-dri:i386":
			return "libgl1-mesa-dri-lts-quantal:i386"

	elif hasPackage( "xserver-xorg-core-lts-raring" ):
		if description == "libgl1-mesa-glx:i386":
			return "libgl1-mesa-glx-lts-raring:i386"
		elif description == "libgl1-mesa-dri:i386":
			return "libgl1-mesa-dri-lts-raring:i386"

	return description


###
def createPackage( description ):
	"""
	Create a package object based on a description.
	This can return None if the package isn't meaningful on this platform.
	"""
	# Look for package substitutions
	description = remapPackage( description )
	if ( description is None ):
		return None

	# Look for architecture conditions, e.g. foo [i386]
	match = re.match( r"(.*) \[([^\]]+)\]", description )
	if match is not None:
		description = match.group(1).strip()
		condition = match.group(2)
		if ( condition[0] == '!' ):
			if ( getArch() == condition[1:] ):
				return None
		else:
			if ( getArch() != condition ):
				return None

	# Look for version requirements, e.g. foo (>= 1.0)
	versionConditions = []
	while True:
		match = re.search( r"\s*\(\s*([<>=]+)\s*([\w\-\.:]+)\s*\)\s*", description )
		if ( match is None ):
			break

		versionConditions.append( ( match.group(1), match.group(2) ) )
		description = description[:match.start()] + description[match.end():]

	return Package( description.strip(), versionConditions )
	


###
def getTerminalCommandLine( title ):
	"""
	Function to find a useful terminal like xterm or compatible
	"""
	if ( "DISPLAY" in os.environ ):
		programs = [
			( "gnome-terminal", ["gnome-terminal", "--disable-factory", "-t", title, "-e"] ),
			( "konsole", ["konsole", "--nofork", "-p", "tabtitle="+title, "-e"] ),
			( "xterm", ["xterm", "-bg", "#383635", "-fg", "#d1cfcd", "-T", title, "-e"] ),
		]
		for (program, commandLine) in programs:
			if ( subprocess.call( ['which', program], stdout=subprocess.PIPE ) == 0 ):
				return commandLine

	# Fallback if no GUI terminal program is available
	return ['/bin/sh']


###
def updatePackages( packages ):
	"""
	Function to install or update package dependencies
	Ideally we would call some sort of system UI that users were familiar with to do this, but nothing that exists yet does what we need.
	"""

	packageList = " ".join( [ package.name for package in packages ] )

	# Create a temporary file to hold the installation completion status
	(fd, statusFile) = tempfile.mkstemp()
	os.close( fd )

	# Create a script to run, in a secure way
	(fd, scriptFile) = tempfile.mkstemp()
	script = """#!/bin/sh
check_sudo()
{
    # If your host file is misconfigured in certain circumstances this
    # can cause sudo to block for a while, which causes gksudo to go into
    # limbo and never return.
    timeout --signal=9 5 sudo -v -S </dev/null 2>/dev/null
    if [ $? -eq 124 -o $? -eq 137 ]; then
        # sudo timed out or was killed due to timeout
        cat <<__EOF__
sudo timed out, your hostname may be missing from /etc/hosts.

See https://support.steampowered.com/kb_article.php?ref=7493-ADXN-9620 for more details.
__EOF__
        return 1
    else
        return 0
    fi
}

cat <<__EOF__
Steam needs to install these additional packages: 
	%s
__EOF__
check_sudo

# Check to make sure 64-bit systems can get 32-bit packages
if [ "$(dpkg --print-architecture)" = "amd64" ] && ! dpkg --print-foreign-architectures | grep i386 >/dev/null; then
    sudo dpkg --add-architecture i386
fi

# Update the package list, showing progress
sudo apt-get update | while read line; do echo -n "."; done
echo

# Install the packages!
sudo apt-get install %s
echo $? >%s
echo -n "Press return to continue: "
read line
""" % ( ", ".join( [ package.name for package in packages ] ), packageList, statusFile )
	os.write( fd, script.encode("utf-8") )
	os.close( fd )
	os.chmod( scriptFile, (stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) )

	try:
		subprocess.call( getTerminalCommandLine( "Package Install" ) + [scriptFile] )
	except KeyboardInterrupt:
		pass
	os.unlink( scriptFile )

	# Read the status out of the file, since if we ran the script in a
	# terminal the process status will be whether the terminal started
	try:
		status = int( open( statusFile ).read() )
	except ValueError:
		# The status wasn't written to the file
		status = 255

	os.unlink( statusFile )

	return status


###
def checkConfig( config ):
	if ( "STEAM_RUNTIME" not in config ):
		sys.stderr.write( "Missing STEAM_RUNTIME definition in %s\n" % sys.argv[1] )
		return False

	if ( config["STEAM_RUNTIME"] not in SUPPORTED_STEAM_RUNTIME ):
		sys.stderr.write( "Unsupported Steam runtime: %s\n" % config["STEAM_RUNTIME"] )
		return False

	if ( "STEAM_DEPENDENCY_VERSION" not in config ):
		sys.stderr.write( "Missing STEAM_DEPENDENCY_VERSION definition in %s\n" % sys.argv[1] )
		return False

	if ( config["STEAM_DEPENDENCY_VERSION"] not in SUPPORTED_STEAM_DEPENDENCY_VERSION ):
		sys.stderr.write( "Unsupported dependency version: %s\n" % config["STEAM_DEPENDENCY_VERSION"] )
		return False

	# Make sure we can use dpkg on this system.
	try:
		subprocess.call( ['dpkg', '--version'], stdout=subprocess.PIPE )
	except:
		sys.stderr.write( "Couldn't find dpkg, please update steamdeps for your distribution.\n" )
		return False

	return True


###
def main():
	config = {}

	# Check the command line arguments
	if ( len(sys.argv) < 2 ):
		sys.stderr.write( "Usage: %s dependencies.txt\n" % sys.argv[0] )
		return 1

	# Make sure we can open the file
	try:
		fp = open(sys.argv[1])
	except Exception as e:
		sys.stderr.write( "Couldn't open file: %s\n" % (e) )
		return 2

	# Look for configuration variables
	config_pattern = re.compile( r"(\w+)\s*=\s*(\w+)" )
	for line in fp:
		line = line.strip()
		if ( line == "" or line[0] == '#' ):
			continue

		match = re.match(config_pattern, line)
		if ( match is not None ):
			config[match.group(1)] = match.group(2)

	# Check to make sure we have a valid config
	if ( not checkConfig( config ) ):
		return 3

	# Seek back to the beginning of the file
	fp.seek(0)

	# Load the package dependency information
	packages = {}
	dependencies = []
	lineNumber = 0
	for line in fp:
		++lineNumber
		line = line.strip()
		if ( line == "" or line[0] == '#' ):
			continue

		match = re.match( config_pattern, line )
		if ( match is not None ):
			continue
	
		row = []
		for section in line.split( "|" ):
			package = createPackage( section )
			if ( package is None ):
				continue

			packages[ package.name ] = package
			row.append( package )

		dependencies.append( row )

	# Print package dependency information for debug
	"""
	for row in dependencies:
		print " | ".join( [ str(package) for package in row ] )
	"""

	# Get the installed package versions
	# Make sure COLUMNS isn't set, or dpkg will truncate its output
	if ( "COLUMNS" in os.environ ):
		del os.environ[ "COLUMNS" ]

	process = subprocess.Popen( ['dpkg', '-l'] + list( packages.keys() ), stdout=subprocess.PIPE, stderr=subprocess.PIPE )
	installed_pattern = re.compile( r"^\Si\s+([^\s]+)\s+([^\s]+)" )
	for line in process.stdout:
		line = line.decode( "utf-8" ).strip()
		match = re.match( installed_pattern, line )
		if ( match is None ):
			continue

		name = match.group(1)
		if ( name not in packages ):
			name = getFullPackageName( name )
		packages[ name ].setInstalled( match.group(2) )

	# See which ones need to be installed
	needed = []
	for row in dependencies:
		if ( len(row) == 0 ):
			continue

		satisfied = False
		for dep in row:
			if ( dep.isAvailable() ):
				satisfied = True
				break
		if ( not satisfied ):
			needed.append( row[0] )

	# If we have anything to install, do it!
	if ( len(needed) > 0 ):
		for package in needed:
			if package.installed:
				print( "Package %s is installed with version '%s' but doesn't match requirements: %s" % (package.name, package.installed, package) )
			else:
				print( "Package %s needs to be installed" % package.name )

		return updatePackages( needed )
	else:
		return 0


if __name__ == "__main__":
	sys.exit(main())
libgl1-mesa-glx:i386 and libgl1-mesa-dri-lts-quantal:i386 probebly shouldnt be installed

Re: Valve Steam on Porteus

Posted: 18 Feb 2014, 04:34
by Kriss
I have Porteus-KDE4-v2.1-x86_64 with Steam.
Everything worked fine on Nvidia. At least Left4Dead 2 worked Ok.
As far as I know all I've done is
1) Created symlink libnotify.so.1 > libnotify.so.4.0.0
2) Added zenity-2.30.0-x86_64-1gsb.xzm
2) deb2xzm steam_latest.deb steam_latest.xzm
4) Edited start script to allow root user to launch it.
3) Made xzm with directories /root/.local/share/Steam and /root/.steam

Oh... And I've added 32 bit drivers (directory /usr/lib/* ) from nVidia-319.32-porteus-v2.1-i486-1ftm.xzm to nVidia-319.32-porteus-v2.1-x86_64-1fmt.xzm

One final note:
Probably the way I installed steam was far from great since it downloaded and installed all dependencies inside "root/.local/share/Steam/ubuntu12_32/steam-runtime/" (that's why there's 800+Mb of data there) and it's possible to use stand-alone modules instead, but I didn't have much time at that moment and it worked fine, so I didn't bother anymore. But since this is a module, it won't update with new versions of steam later. ;)

Re: Valve Steam on Porteus

Posted: 19 Feb 2014, 12:54
by ztealmax
Thanx i will give it a try again

could you possible share the modules you made of steam?

now trying to locate zenity-2.30.0-x86_64-1gsb.xzm
and figure out symlink etc ;)

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 02:09
by brokenman
search for: zenity-2.30.0-x86_64-1gsb.txz

The gsb tag stands for: gnome slack builds

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 09:48
by Kriss
http://dl.porteus.org/x86_64/current/ex ... 64-1sl.xzm
http://www.mediafire.com/download/9gvio ... 4-1gsb.xzm
http://www.mediafire.com/download/ropra ... ymlink.xzm
http://www.mediafire.com/download/3u98w ... -09-04.xzm
http://www.mediafire.com/download/22zzc ... -02-20.xzm

This works on Porteus 2.1 x86_64 kde4 (checked today on Half-Life 2 and deleted private info) but doesn't work on 3.0rc2.
I can also add edited nVidia driver module merged with x86 one but it seems you use ATi, so you won't need it.

BTW, Fanthom, did you add x86 libs to x86_64 drivers for 3.0? I just checked and it seems so...
And I still can't activate modules inside "/media/SP UFD U2/..."

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 09:59
by fanthom
did you add x86 libs to x86_64 drivers for 3.0? I just checked and it seems so...
yes - 64bit nVidia installer has an option to include 32bit libs and i'm using this option when creating module. however - one user reported that some bits are still missing so would be good if someone could verify that.

And I still can't activate modules inside "/media/SP UFD U2/..."
activate wont support whitespaces as it breaks activation of multiple modules at once.
btw: in 3.0 you wont get anything mounted under '/media/name' cause we have a wrapper which puts everything under /mnt/sdXY so this problem should be gone. this wrapper is already in 2.1 (bit buggy comparing to 3.0) so you should have it under /mnt even right now.

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 10:33
by Kriss
I'll try to test drivers whenever I got steam (or wine) working on 3.0rc2.
And indeed, 2.1 didn't use "/media" but 3.0rc2 uses it for Porteus removable drive with copy2ram.

EDIT: Changed symlink /usr/lib/libGL.so.1 to point to /usr/lib/libGL.so.1.2 instead of /usr/lib/libGL.so.319.76 and steam works on 3.0rc2 x86_64 kde4. At least it started to update instead of segafulting...
But got warning: "OpenGL GLX context is not using direct rendering..."

Replaced "/usr/lib" with one from 32 bit driver (only files, not subdirectories) with no effect
Copied entire "/usr/lib" (with subdirectories) from 32bit drivers to 64 bit ones and everything works. =)
So only subdirectories were missing from /usr/lib/ (please forget about symlink, it wasn't source of the problem and was overwritten with original link shortly after)

Playing HL2 now with my steam modules, edited nVidia drivers and clean Porteus 3.0rc2 x86_64 kde4

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 14:48
by ztealmax
Testing this when i get home from work :)

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 17:53
by fanthom
2.1 didn't use "/media" but 3.0rc2 uses it for Porteus removable drive with copy2ram.
is this happening on KDE4?

Copied entire "/usr/lib" (with subdirectories) from 32bit drivers to 64 bit ones and everything works. =)
ok - this is confirming what we discovered previously. will fix 64bit nVidia drivers for 3.0 final.
thanks

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 19:13
by Kriss
fanthom wrote:2.1 didn't use "/media" but 3.0rc2 uses it for Porteus removable drive with copy2ram.
is this happening on KDE4?
Yes.
fanthom wrote:Copied entire "/usr/lib" (with subdirectories) from 32bit drivers to 64 bit ones and everything works. =)
ok - this is confirming what we discovered previously. will fix 64bit nVidia drivers for 3.0 final.
thanks
Thank you and you're welcome! =)

Re: Valve Steam on Porteus

Posted: 20 Feb 2014, 21:09
by ztealmax
by fanthom ยป 20 Feb 2014, 18:53 Copied entire "/usr/lib" (with subdirectories) from 32bit drivers to 64 bit ones and everything works. =)
ok - this is confirming what we discovered previously. will fix 64bit nVidia drivers for 3.0 final.
thanks

When i get abit more time tomorow evening i must test if it works on my AMD Radeon HD 5000 the same solution as nvidia
Copy entire "/usr/lib" (with subdirectories) from 32bit drivers to 64 bit

Really really hopes that works for me to ;)