Ricks-Lab / gpu-utils

A set of utilities for monitoring and customizing GPU performance
GNU General Public License v3.0
133 stars 23 forks source link

env.py: conversion of hexadecimal to int fails #131

Closed wkernkamp closed 2 years ago

wkernkamp commented 2 years ago

Had a problem that I solved with the attached diff on python3/dist-packages/GPUmodules/env.py

The strip() is not necessary, but without the 0, int() tries to convert a base-10 text (like '123456') and not '0xfffd7fff'. This will cause gpu-ls and gpu-mon to fail. env.py.txt .

Ricks-Lab commented 2 years ago

Thanks for raising the issue! Which version are you using? Here is the latest code in the repository:

            with open(self.featuremask, 'r', encoding='utf-8') as fm_file:
                fm_str = fm_file.readline().rstrip()
                LOGGER.debug('Raw Featuremask string: [%s]', fm_str)
                self.amdfeaturemask = int(fm_str, 0)

I have had two issues that seemed to be python version dependent, but I think the above works in past issue cases.

Ricks-Lab commented 2 years ago

Resolved in a previous release.