Large update to configs
This commit is contained in:
@ -18,24 +18,24 @@ local nvsmi = {}
|
||||
|
||||
-- {{{ GPU Information widget type
|
||||
local function worker(format, warg)
|
||||
-- Fallback to querying first device
|
||||
if not warg then warg = "0" end
|
||||
-- Fallback to querying first device
|
||||
if not warg then warg = "0" end
|
||||
|
||||
-- Get data from smi
|
||||
-- * Todo: support more; MEMORY,UTILIZATION,ECC,POWER,CLOCK,COMPUTE,PIDS,PERFORMANCE
|
||||
local f = io.popen("nvidia-smi -q -d TEMPERATURE -i " .. warg)
|
||||
local smi = f:read("*all")
|
||||
f:close()
|
||||
-- Get data from smi
|
||||
-- * Todo: support more; MEMORY,UTILIZATION,ECC,POWER,CLOCK,COMPUTE,PIDS,PERFORMANCE
|
||||
local f = io.popen("nvidia-smi -q -d TEMPERATURE -i " .. warg)
|
||||
local smi = f:read("*all")
|
||||
f:close()
|
||||
|
||||
-- Not installed
|
||||
if smi == nil then return {0} end
|
||||
-- Not installed
|
||||
if smi == nil then return {0} end
|
||||
|
||||
-- Get temperature information
|
||||
local _thermal = string.match(smi, "Gpu[%s]+:[%s]([%d]+)[%s]C")
|
||||
-- Handle devices without data
|
||||
if _thermal == nil then return {0} end
|
||||
-- Get temperature information
|
||||
local _thermal = string.match(smi, "Gpu[%s]+:[%s]([%d]+)[%s]C")
|
||||
-- Handle devices without data
|
||||
if _thermal == nil then return {0} end
|
||||
|
||||
return {tonumber(_thermal)}
|
||||
return {tonumber(_thermal)}
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
Reference in New Issue
Block a user